Coder Social home page Coder Social logo

webmining's Introduction

Web Structured Extraction

webMining binaries

Download Windows x86_64 static binaries

Usage

For offline documents:

./run.sh file.html

For online documents, using remotely controlled browser (Chrome + w3c web driver):

./webDriver.sh http://host/uri

Example script (basic.lua)

To run the script bellow, open chromedriver in another terminal and:

./webMining -debug -i basic.lua http://url > output.txt 2> output.debug.txt

basic.lua

CRLF = '\n'
extractURL = function(url, html, minPSD, minCV) -- loads and parses HTML into a DOM tree 
	local dom = DOM.new(url, html)

	-- instantiates an extractor
	local dsre = DSRE.new() 

	-- sets z-score and CV thresholds
	dsre:setMinPSD(minPSD)
	dsre:setMinCV(minCV)

	-- extract records
	dsre:extract(dom)

	local regions = dsre:regionCount()

	-- iterates over regions
	for i=1,regions do
		local dr = dsre:getDataRegion(i-1)
		local rows = dr:recordCount()
		local cols = dr:recordSize()
		local content = ''
		if dr:isContent() then
			content = 'CONTENT DETECTED'
		end
		print('Region #', i, content, ': ')

	-- iterates over current region's
	-- rows and columns
		for r=1,rows do  
			local record = dr:getRecord(r-1)
			for c=1,cols do
	-- output field value
				if (record[c] ~= nil) then
					io.write(record[c]:toString())
				end
				io.write(';')
			end
			io.write(CRLF)
		end
	end
end

local driver = webDriver.chrome

if #args > 4 then
	local url = args[5]
	driver:newSession()
	driver:go(url)
	local html = driver:getPageSource()
	extractURL(url, html, 9.0, 0.30)
end

Publications

Paper published in CIKM'17

Paper published in ICWE'19

Paper published in SBBD'20

Building from source

make

deps (Ubuntu and Windows)

libcurl3-dev, liblua5.3-dev, python3-dev

webmining's People

Contributors

rpvelloso avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

webmining's Issues

Some problems and ideas

I had some problems getting the code to run:

  • I had to use pyhton-3.8 (because of my linux distro)
  • some python libs needed older versions (mlxtend, skicit-learn), and fix the classifier.py code
  • in util.cpp an include was missing: #include
    The readme should be updated, as there is no webmining.sh script, and the webmining-binary is generated in folder above the scripts.
    I finally succeeded.

Some more ideas:

  • you rely on the dom, which may be insufficient, if pages are generated manually. I stumbled upon this thesis:
    "A Pure Visual Approach for Automatically Extracting and Aligning Structured Web Data" by Fadwa M A Estuka
    https://era.library.ualberta.ca/items/87f248e2-828c-4a88-b326-764d37027c5a
    Maybe optionally use an immediate dom representation, which completely relies on visual features could remove some problems with non-db-sourced records (but would require rendering)
    In this work maybe some other ideas, which could help to combine visual features and your approach.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.