简体   繁体   English

使用 Selenium 和 Python 提取表数据

[英]Extracting table data using Selenium and Python

I am working on a project scraping a table off a web site.我正在做一个项目,从 web 网站上刮掉一张桌子。 I am not able to give full code as this is a company specific site with a login.我无法提供完整的代码,因为这是一个登录的公司特定站点。 Basically, I am trying to fetch the records from webtable where nore than 100 records present but at a time only 12 records are displaying on screen.I tried to get records using scrollbar but it failed to do so.Kindly help me to get all records in excel sheet.Thanks in advance.基本上,我正在尝试从存在不超过 100 条记录的 webtable 中获取记录,但屏幕上一次只显示 12 条记录。我尝试使用滚动条获取记录,但没有这样做。请帮助我获取所有记录在 excel 表中。提前致谢。 I am adding my code below.我在下面添加我的代码。

from lxml import etree
import urllib.request
import requests
import pandas as pd
from bs4 import BeautifulSoup
url = "https//"
pd.read_html(requests.get(url,verify=False))
df = pd.read_html(url)

I am getting below error:我收到以下错误:

TypeError: cannot parse from 'Response' TypeError:无法从“响应”解析

You need to change你需要改变

pd.read_html(requests.get(url,verify=False))

to

pd.read_html(requests.get(url,verify=False).content)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM