【发布时间】:2019-12-10 07:03:25
【问题描述】:
import requests
from bs4 import BeautifulSoup
import pandas as pd
url = "https://ege.hse.ru/rating/2019/81031971/all/?rlist=&ptype=0&vuz-abiturients-budget-order=ge&vuz-abiturients-budget-val=10"
page = requests.get(url)
soup = BeautifulSoup(page.content, 'html.parser')
tbl = soup.find("table", {"id": "transparence_t"})
data_frame = pd.read_html(str(tbl))[0]
data_frame.to_csv('hseparser.csv')
我解析它,但数据在 A1 到 A699 单元格上。我需要将数据粉碎到不同的单元格。请帮帮我!
【问题讨论】:
-
一切都是俄语。你能发布想要的结果吗
-
数据在标签
和 中完美排列,你可以轻松运行 for循环,将数据排列在DF中。这能回答你的问题吗? Web scrapping with Python
标签: python pandas beautifulsoup