run_browser: Start up web driver process on localhost, with a random port

Description Usage Arguments Details Value Examples

View source: R/run_webdriver.R

Description

Phantomjs is a headless browser, it provide automated control of a web page in an environment similar to web browsers, but via a command-line. It's able to render and understand HTML the same way a regular browser would, including styling elements such as page layout, colors, font selection and execution of JavaScript and AJAX which are usually not available when using GET request methods.

Usage

1
run_browser(debugLevel = "DEBUG", timeout = 5000)

Arguments

debugLevel

debug level, possible values: 'INFO', 'ERROR', 'WARN', 'DEBUG'

timeout

How long to wait (in milliseconds) for the webdriver connection to be established to the phantomjs process.

Details

This function will throw an error if webdriver(phantomjs) cannot be found, or cannot be started. It works with a timeout of five seconds.

If you got the forllwing error, this means that your operating system or antivirus is bloking the webdriver (phantom.js) process, try to disable your antivirus temporarily or adjust your system configuration to allow phantomjs and processx executable (browser_path to know where phantomjs is located). Error in supervisor_start() : processx supervisor was not ready after 5 seconds.

Value

A list of callr::process object, and port, the local port where phantom is running.

Examples

1
2
3
4
5
6
7
8
9
## Not run: 

#If driver is not installed yet then
install_browser()

br<-run_browser()


## End(Not run)

salimk/Rcrawler documentation built on May 25, 2020, 5:02 p.m.