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