开发者

Access a URL (w/ cookies) using sockets?

开发者 https://www.devze.com 2023-02-08 11:42 出处:网络
I\'m trying to write开发者_开发百科 a program that uses sockets to connect to a website and save data from it. The issue I have is that I can\'t figure out how to connect to something besides index.ph

I'm trying to write开发者_开发百科 a program that uses sockets to connect to a website and save data from it. The issue I have is that I can't figure out how to connect to something besides index.php. Like, say I want to connect to page1.php instead of index.php. Can anyone help me with that?

Also, is there a way to get all the data at once, rather than in chunks? Or do I just have to loop until I'm done?

Thanks in advance for your help.


You need to be using the urllib2 and cookielib modules. Here's an example from the Python Cookbook (see more).

0

精彩评论

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