Update GAT.py

This commit is contained in:
frxz751113
2024-09-30 01:58:51 +08:00
committed by GitHub
parent 6daba18bf1
commit 4dae1cbb33
+2 -2
View File
@@ -19,10 +19,10 @@ output_file = 'gat.txt'
with open(output_file, 'w', encoding='utf-8') as f:
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)
if response.status_code == 200:
# 使用BeautifulSoup解析网页内容并提取文本
soup = BeautifulSoup(response.text, 'html.parser')
text_content = soup.get_text()
f.write(text_content + '\n')