我正在尝试抓取的网站使用js创建一个cookie.我在想的是我可以在python中创建一个cookie,然后使用该cookie来抓取网站.但是,我不知道如何做到这一点.有人有什么想法吗?
解决方法:
有关向请求添加cookie的示例,请参阅Python httplib2 – Handling Cookies in HTTP Form Posts.
I often need to automate tasks in web
based applications. I like to do this
at the protocol level by simulating a
real user’s interactions via HTTP.
Python comes with two built-in modules
for this: urllib (higher level Web
interface) and httplib (lower level
HTTP interface).