Usage

To use PollScraper in a project:

import pollscraper

To use the PollScraper CLI:

$ pollscraper --debug {debug_level} --url {url} --results {output_file}

PollScraper Options

main

main [OPTIONS]

Options

--url <url>

Target URL containing polling data.

--results_dir <results_dir>

Location for scraped polling data to be stored.

--n_sigma <n_sigma>

Number of standard deviations away from the mean at which a warning will be raised when checking the polling data per candidate.

--quiet

Reduce streamed logging output. (This does not affect output in the log file)

--n_places <n_places>

Set floating point precision stored in the output .csv files.

--connect_timeout <connect_timeout>

The connect timeout is the number of seconds Requests will wait for your client to establish a connection to a remote machine (corresponding to the connect()) call on the socket. It’s a good practice to set connect timeouts to slightly larger than a multiple of 3, which is the default TCP packet retransmission window.

--read_timeout <read_timeout>

Once your client has connected to the server and sent the HTTP request, the read timeout is the number of seconds the client will wait for the server to send a response.

--http_n_retries <http_n_retries>

Sets number of automatic retries to connect to target HTML after failed connection