Python中文
首页
教程
问答
标签
搜索
登录
注册
一个(大概是基本的)网页抓取http://www.ssa.gov/cgibin/popularnames.cgi在urllib中
回答此问题可获得
20
贡献值,回答如果被采纳可获得
50
分。
<p>我对Python(和web抓取)很陌生。让我问你一个问题。在</p> <p>实际上,许多网站并不在Firefox或其他浏览器中报告其特定的url。例如,社会保险管理显示流行的婴儿名字和等级(从1880年开始),但当我把年份从1880年改为1881年时,网址没有改变。它是不断的</p> <p><a href="http://www.ssa.gov/cgi-bin/popularnames.cgi" rel="nofollow">http://www.ssa.gov/cgi-bin/popularnames.cgi</a></p> <p>因为我不知道具体的网址,我无法下载网页使用urllib。在</p> <p>在此页面源中,它包括:</p> <p><code><input type="text" name="year" id="yob" size="4" value="1880"></code></p> <p>所以假设,如果我能控制这个“年”值(比如“1881”或“1991”),我就可以处理这个问题。我说得对吗?我还是不知道怎么做。在</p> <p>有谁能告诉我解决这个问题的办法吗?在</p> <p>如果你知道一些有助于我学习的网站,请告诉我。在</p> <p>谢谢!在</p>
0 条评论
分类:
Python问答
请先
登录
后评论
默认排序
时间排序
1 个回答
匿名
1天前
擅长:python、mysql、java
<p>我建议使用<a href="http://wwwsearch.sourceforge.net/mechanize/" rel="nofollow">mechanize</a>之类的工具。这将允许您使用python以编程方式导航web页面。有很多关于如何使用这个的教程。基本上,你想在mechanize中做的和在浏览器中做的一样:填充文本框,点击“Go”按钮,解析你从响应中得到的网页。在</p>
请先
登录
后评论
针对此问题:
更多的回答
关注
89
关注
收藏
1
收藏,
216
浏览
网友 提问于 2天前
相关Python问题
无法使用Django/mongoengine连接到MongoDB(身份验证失败)
7 回答
无法使用Django\u mssql\u后端迁移到外部hos
5 回答
无法使用Django&Python3.4连接到MySql
2 回答
无法使用Django+nginx上载媒体文件
5 回答
无法使用Django1.6导入名称模式
10 回答
无法使用Django1.7和mongodb登录管理站点
1 回答
无法使用Djangoadmin创建项目,进程使用了错误的路径,因为我事先安装了错误的Python
5 回答
无法使用Djangockedi验证CBV中的字段
3 回答
无法使用Djangocketditor上载图像(错误400)
10 回答
无法使用Djangocron进行函数调用
8 回答
无法使用Djangofiler djang上载文件
7 回答
无法使用Djangokronos
4 回答
无法使用Djangomssql provid
1 回答
无法使用Djangomssql连接到带有Django 1.11的MS SQL Server 2016
1 回答
无法使用Djangomssq迁移Django数据库
1 回答
无法使用Djangonox创建用户
5 回答
无法使用Djangopyodb从Django查询SQL Server
4 回答
无法使用Djangopython3ldap连接到ldap
9 回答
无法使用Djangoredis连接到redis
8 回答
无法使用Django中的FK创建新表
10 回答