开发者

Get DOM from webpage in python

开发者 https://www.devze.com 2023-03-14 19:03 出处:网络
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

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消