Update GAT.py
This commit is contained in:
@@ -19,10 +19,10 @@ output_file = 'gat.txt'
|
|||||||
|
|
||||||
with open(output_file, 'w', encoding='utf-8') as f:
|
with open(output_file, 'w', encoding='utf-8') as f:
|
||||||
for keyword in keywords:
|
for keyword in keywords:
|
||||||
url = f'http://tonkiang.us/?&iqtv={keyword}'
|
for page in range(1, 11):
|
||||||
|
url = f'http://tonkiang.us/?page={page}&iqtv={keyword}'
|
||||||
response = requests.get(url)
|
response = requests.get(url)
|
||||||
if response.status_code == 200:
|
if response.status_code == 200:
|
||||||
# 使用BeautifulSoup解析网页内容并提取文本
|
|
||||||
soup = BeautifulSoup(response.text, 'html.parser')
|
soup = BeautifulSoup(response.text, 'html.parser')
|
||||||
text_content = soup.get_text()
|
text_content = soup.get_text()
|
||||||
f.write(text_content + '\n')
|
f.write(text_content + '\n')
|
||||||
|
|||||||
Reference in New Issue
Block a user