from bs4 import BeautifulSoup #引用BeautifulSoup庫
import requests #引用requests
import os #os
import pandas as pd
import csv
import codecs
lst=[]
url='http://datachart.500.com/dlt/history/newinc/history.php?start=07001end=21018'
r = requests.get(url)
r.encoding='utf-8'
text=r.text
soup = BeautifulSoup(text, "html.parser")
tbody=soup.find('tbody',id="tdata")
tr=tbody.find_all('tr')
td=tr[0].find_all('td')
for page in range(0,14016):
td=tr
12下一頁閱讀全文
您可能感興趣的文章:- Python爬蟲實例——爬取美團美食數(shù)據(jù)
- Python基于pandas爬取網(wǎng)頁表格數(shù)據(jù)
- python 爬取疫情數(shù)據(jù)的源碼
- 用python爬取歷史天氣數(shù)據(jù)的方法示例
- 基于Python的Post請求數(shù)據(jù)爬取的方法詳解
- Python3實現(xiàn)的爬蟲爬取數(shù)據(jù)并存入mysql數(shù)據(jù)庫操作示例