Python dryscrape scrape page with cookies

前端 未结 1 839
梦如初夏
梦如初夏 2021-02-09 06:18

I wanna get some data from site, which requires loggin in.
I log in by requests

url = \"http://example.com\"
response = requests.get(url, {         


        
1条回答
  •  面向向阳花
    2021-02-09 07:09

    Why not login by dryscrape?

    session = dryscrape.Session()
    session.visit('')
    name = session.at_xpath('//*[@name="username"]') # Where 
    name.set("")
    password = session.at_xpath('//*[@name="password"]') # Where 
    password.set("")
    # Push the button
    name.form().submit()
    session.visit("")
    

    0 讨论(0)
提交回复
热议问题