Python gnashing cookie pages

I want to get some data from the site, which requires a login.
I log in using queries

url = "http://example.com" response = requests.get(url, {"email":" a@gmail.com ", "password":"12345"}) cookies = response.cookies 

Then I want to get data from some JS page. This is not possible through queries , so I need to use dryscrape for this.

 import dryscrape url = "http://example.com/js-page" sess = dryscrape.Session() sess.visit(url) 

Is it possible to pass cookies to visit () or do I need to look for another solution?

+6
source share
1 answer

Why not log in with dryscrape?

 session = dryscrape.Session() session.visit('<url_where_is_login_form>') name = session.at_xpath('//*[@name="username"]') # Where <input name="username"> name.set("<login>") password = session.at_xpath('//*[@name="password"]') # Where <input name="password"> password.set("<password>") # Push the button name.form().submit() session.visit("<url to visit with proper cookies>") 
+6
source

All Articles