抓取需要使用 Python 登录的站点 [英] Scraping sites that require login with Python

查看:52
本文介绍了抓取需要使用 Python 登录的站点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我为我的网站使用了多个广告网络,为了查看我赚了多少钱,我需要每天登录以将价值相加.我正在考虑制作一个 Python 脚本,该脚本可以为我快速完成此操作.我知道我需要执行 POST 请求才能登录,然后存储我返回的 cookie,然后在传递这些 cookie 的同时 GET 请求报告页面.

I use several ad networks for my sites, and to see how much money I made I need to log in to each daily to add up the values. I was thinking of making a Python script that would do this for me to get a quick total. I know I need to do a POST request to log in, then store the cookies that I get back and then GET request the report page while passing in those cookies.

在 Python 中复制我手动浏览网站时所做的事情最方便的方法是什么?

What's the most convenient way to replicate in Python what I'm doing when I browse the sites manually?

推荐答案

看看这是否适合你:

http://stockrt.github.com/p/emulating-a-browser-in-python-with-mechanize/

这篇关于抓取需要使用 Python 登录的站点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆