You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
1022 B
Python
24 lines
1022 B
Python
import requests
|
|
import parsel
|
|
from tqdm import tqdm
|
|
import time
|
|
import csv
|
|
|
|
header = {
|
|
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36",
|
|
# "Cookie": "_bl_uid=g9ld3se62R4uz3xICmC3jksen8CO; member_id=1295895; pass_hash=60c367c69b5cd4b8ef6780634d5dd292; member_name=solaryusa; mqtids=%2C; session_id=4c04b006bf42205767eae453eb09c036; topicsread=a%3A1%3A%7Bi%3A358346%3Bi%3A1709013153%3B%7D"
|
|
}
|
|
|
|
for page in tqdm(range(0,5652,50)):
|
|
time.sleep(5)
|
|
url = "http://molbiol.ru/forums/index.php?showtopic=358346&st={}".format(page)
|
|
response = requests.get(url=url,headers=header).text
|
|
select = parsel.Selector(response)
|
|
links = select.xpath('//*[@id="ipbwrapper"]/div[2]//noindex/a/@href').getall()
|
|
for link in links:
|
|
with open("molbiol-ru潜在注册链接.csv", mode="a", encoding="utf-8", newline="") as f:
|
|
csv_writer = csv.writer(f)
|
|
csv_writer.writerow([link,])
|
|
|
|
|