Closed Alipser closed 1 year ago
There are two ways to do this,
First if you want to set everything up by yourself then for that the actual WebPage
element is located in the pywebcopy.core
submodule. So you would do something like this
from pywebcopy.core import WebPage
and then create an instance and so on.
But secondly if you want to only change a few variables then you can just copy the insides of the save_webpage
function and do something like this
from pywebcopy.config import get_config
config = get_config(url, project_folder, project_name, bypass_robots, debug, delay, threaded)
webpage = config.create_page()
# here you have the ready webpage instance to do anything
webpage.session.header = anything
webpage.get(url)
webpage.save_complete(pop=open_in_browser)
I can't figure out how to change the header to set the user-agent