如何自动导航到需要身份验证的网站?
这就是我想要实现的目标。我想编写一个脚本,该脚本将导航到一个需要我进行身份验证的网站,例如 Facebook、Live Spaces、Twitter 或任何其他网站,然后让该脚本在网站的一个页面上搜索某些信息。
我过去曾使用 Windows.Forms WebBrowser 控件做过类似的事情,它是 IE 的完整实现,可以通过代码进行控制,并且会存储您通过身份验证后获得的任何 cookie,但它对修改,我希望改用脚本语言,也许是 Powershell 或类似的语言。
网络上可能有一些关于此的好的教程吗?
谢谢!
Here's what I'm trying to achieve. I would like to write a script that will navigate to a website that requires me to be authenticated as myself, say Facebook, Live Spaces, Twitter or any other, and then have that script search for certain information on one of the pages of the website.
I've done something similar in the past with the Windows.Forms WebBrowser control, which is a full blown implementation of IE that can be controlled through code and will store whatever cookies you get once you're authenticated, but it was very unfriendly to modify and I was hoping to use a scripting language instead, maybe Powershell or something of that sort.
Are there maybe some good tutorials about this out there on the web?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
如果 Python 是您的首选,Mechanize + 斜纹 + 美丽汤。
也看看 SO screen-scraping 标签。
If Python is your first choice, Mechanize + Twill + Beautiful Soup.
Have a look to SO screen-scraping tag too.
有很多选择。过去,我使用 Chickenfoot 或来自控制台与 Mechanize。
然后抓取该网站并检查每个页面的 HTML 中是否有您的数据。
There are many alternatives. In the past I have automated my browser around authenticated sites with Chickenfoot, or from the console with Mechanize.
Then crawl the site and examine each pages HTML for your data.
您可以使用 IRobotSoft 网络抓取工具。它自动执行用于 Web 数据挖掘的 IE WebBrowser 控件。请参阅他们的论坛 http://www.irobotsoft.org/bb/ 了解典型问题。
You can use IRobotSoft web scraper. It automates an IE WebBrowser control for web data mining. See their forum here http://www.irobotsoft.org/bb/ for typical questions.
我创建了一个新的 PowerShell 模块,目前处于技术预览阶段。尝试 http://facebookpsmodule.codeplex.com,并让我知道这对您有何帮助!
I have created a new PowerShell module, currently in Technology Preview. Try http://facebookpsmodule.codeplex.com, and let me know how this works for you!