How can I pass my ID and my password to a website in Python using Google App Engine?

前端 未结 2 1761
我在风中等你
我在风中等你 2021-01-24 01:41

Here is a piece of code that I use to fetch a web page HTML source (code) by its URL using Google App Engine:

from google.appengine.api import urlfetch
url = \"h         


        
2条回答
  •  萌比男神i
    2021-01-24 02:33

    As Alex said you can check for status code and see what type of autorization it wants, but you can not generalize it as some sites will not give any hint or only allow login thru a non standard form, in those cases you may have to automate the login process using forms, for that you can use library like twill (http://twill.idyll.org/) or code a specific form submit for each site.

提交回复
热议问题