pywebcopy icon indicating copy to clipboard operation
pywebcopy copied to clipboard

how to pass cookies with V7.0

Open a2689378 opened this issue 2 years ago • 3 comments

pywebcopy.SESSION Becomes unusable in the new version

a2689378 avatar Aug 08 '22 05:08 a2689378

module 'pywebcopy' has no attribute 'SESSION'

a2689378 avatar Aug 08 '22 06:08 a2689378

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 avatar Aug 08 '22 16:08 rajatomar788

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

rajatomar788 avatar Aug 09 '22 05:08 rajatomar788

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.

likohank avatar Jan 24 '24 08:01 likohank

@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)

rajatomar788 avatar Jan 24 '24 16:01 rajatomar788