Get DOM from webpage in python
hello guys i'm wondering how to get DOM from web page ! so check out this Example.com>Get Dom>Get Document from Dom > Get Cookie Values from Document
i tried this code but not working
response.urllib2.urlopen('http://Example.com')
print response.info().getheader("cookie")
also i tried print response.read()
but it's ouput None for print response.info().getheader("cookie")
i tried Set-Cookie
i got values but not exact same from the broswer !! i open the web via webtext editor (Firebug) and i got diffrent information开发者_C百科 so i'm confused is Set-Cookie equal to cookie
i dunno please give me some suggest
There is something here about HTTP Cookies with Python. You might actually be better off using / learning about python's httplib / http.client documented here, that would allow you to simulate / build an http client. Or even use the more generic urllib documented here, that handle more protocols / arbitrary resources, and with it say you can access headers via the urllib.urlretrieve
method is there were any.
精彩评论