发布到页面以使用美丽的汤登录 [英] post to page to login using beautiful soup

查看:11
本文介绍了发布到页面以使用美丽的汤登录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 python 和 beautifulsoup(两者都是新手!),我想登录供应商网站.

I'm using python and beautifulsoup (new to both!), and I want to login to a suppliers website.

所以他们的形式看起来像(简化):

So their form looks like (simplified):

<form name=loginform action=/index.html method="post">

<input name=user>
<input name=pass">

</form>

有没有办法跟踪 cookie?

Is there a way to keep track for cookies?

推荐答案

多读点书.

阅读有关 urllib2 的内容,这就是您用来执行 POST 登录的内容.如果您知道 名称,则不需要 Beautiful Soup.http://docs.python.org/library/urllib2.html

Read about urllib2 That's what you use to do a POST to login. If you know the <input> names, you don't need Beautiful Soup. http://docs.python.org/library/urllib2.html

Beautiful Soup 是用来解析一页结果的.登录后.在您发布真实请求之后.

Beautiful Soup is what you use to parse a page of results. After you login. After you post the real request.

这篇关于发布到页面以使用美丽的汤登录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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