Python Markdown extension to include local or remote files
Project description
PhantomJS wrapper in Python
Pre requisites
Install phantomjs
command line tool.
Install
pip install phantomjs
Usage
from phantomjs import Phantom
phantom = Phantom()
conf = {
'url': 'http://example.com/', # Mandatory field
'output_type': 'html', # json for json
'min_wait': 1000, # 1 second
'max_wait': 30000, # 30 seconds
'selector': '', # CSS selector if there's any
'resource_timeout': 3000, # 3 seconds
'headers': {
"User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.72 Safari/537.36",
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3",
"Sec-Fetch-Mode": "navigate",
'Sec-Fetch-Site': 'same-origin',
'Upgrade-Insecure-Requests': '1',
},
'cookies': [
{'name': '_Country', 'value': 'US', 'domain': '.google.com',},
{'name': '_Currency', 'value': 'USD', 'domain': '.google.com',},
],
}
output = phantom.download_page(conf)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
phantomjs-1.0.0.tar.gz
(3.2 kB
view hashes)
Built Distribution
Close
Hashes for phantomjs-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a00bedb6631abba108ffe898a65a5f29f9a9ce9813d35f2113daf765d91da9c0 |
|
MD5 | a0d1687efd02adfbfe74e80ea789e943 |
|
BLAKE2b-256 | c284b17f3907d9b7180a7059a8f97218282da08e53287ed514b0fd83c1cc9021 |