rajatomar788 / pywebcopy

Locally saves webpages to your hard disk with images, css, js & links as is.
https://rajatomar788.github.io/pywebcopy/
Other
520 stars 105 forks source link

how to pass cookies with V7.0 #104

Closed a2689378 closed 1 year ago

a2689378 commented 2 years ago

pywebcopy.SESSION Becomes unusable in the new version

a2689378 commented 2 years ago

module 'pywebcopy' has no attribute 'SESSION'

rajatomar788 commented 2 years ago

pywebcopy.SESSION Becomes unusable in the new version

This code that you wrote is for previous versions. Read the new documentation before reaching conclusions.

rajatomar788 commented 2 years ago

To set the cookies use the webpage.session object. You can even fill forms using Page object.

likohank commented 7 months ago

I have the same question as the asker and feel that it would be better to have more examples of cookies. Thank you for your work.

rajatomar788 commented 7 months ago

@likohank

from pywebcopy.configs import get_config

config = get_config(url, project_folder, project_name, bypass_robots, debug, delay, threaded)

page = config.create_page()

# here set your cookies
page.session.cookies.set('session-id', 'xxx')

page.get(url)

page.save_complete(pop=open_in_browser)