【发布时间】:2020-09-11 07:48:26
【问题描述】:
我正在寻找一个 python 模块,它可以让我浏览网站的搜索栏、链接等。 对于上下文,我希望对该网站进行一些网络抓取 [https://www.realclearpolitics.com/] 我只是想获取与 2020 年选举相关的每个州的信息(民意调查数据等),并将其全部组织到一个数据库集合中。 显然有很多状态要经过,每个状态都在一个单独的网页上。因此,我正在寻找一种 Python 方法,在该方法中我可以快速浏览网站并获取每个页面的数据等,以及更新和添加到现有数据。因此,找到一种使用我输入的数据快速导航链接和搜索栏的方法将非常有帮助。 任何建议将不胜感激。
# a simple list that contains the names of each state
states = ["Alabama", "Alaska" ,"Arizona", "....."]
for state in states:
#code to look up the state in the searchbar of website
#figures being taken from website etc
break
这是我的粗略想法
【问题讨论】:
-
试试Selenium。
标签: python html python-3.x web-scraping navigation