mirror of
https://github.com/simon987/mobilism_scrape.git
synced 2025-04-10 14:26:44 +00:00
debug
This commit is contained in:
parent
7f494fd8f1
commit
57b994cc65
8
run
8
run
@ -58,6 +58,9 @@ def do_premium_download(link, i):
|
||||
soup = BeautifulSoup(r.content, "html.parser")
|
||||
form = soup.find("form")
|
||||
|
||||
with open("debug.do_premium_download.html", "wb") as f:
|
||||
f.write(r.content)
|
||||
|
||||
if not form:
|
||||
if "The file you were looking for could not be found" not in r.text:
|
||||
print(r.content, file=stderr)
|
||||
@ -88,6 +91,9 @@ def parse_topic(topic_url):
|
||||
r = session.get(topic_url)
|
||||
soup = BeautifulSoup(r.content, "html.parser")
|
||||
|
||||
with open("debug.parse_topic.html", "wb") as f:
|
||||
f.write(r.content)
|
||||
|
||||
for i, elem in enumerate(soup.find_all(class_="postlink")):
|
||||
if not elem.get("href"):
|
||||
continue
|
||||
@ -110,6 +116,8 @@ def login():
|
||||
}, headers={
|
||||
"Content-Type": "application/x-www-form-urlencoded"
|
||||
})
|
||||
with open("debug.login.html", "wb") as f:
|
||||
f.write(r.content)
|
||||
|
||||
|
||||
topic_id = get_topic_id(TOPIC_URL)
|
||||
|
Loading…
x
Reference in New Issue
Block a user