簡體   English   中英

使用 Selenium 和 Python 提取表數據

[英]Extracting table data using Selenium and Python

我正在做一個項目,從 web 網站上刮掉一張桌子。 我無法提供完整的代碼,因為這是一個登錄的公司特定站點。 基本上,我正在嘗試從存在不超過 100 條記錄的 webtable 中獲取記錄,但屏幕上一次只顯示 12 條記錄。我嘗試使用滾動條獲取記錄,但沒有這樣做。請幫助我獲取所有記錄在 excel 表中。提前致謝。 我在下面添加我的代碼。

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)

我收到以下錯誤:

TypeError:無法從“響應”解析

你需要改變

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

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM