Commit 07bc5fe6 authored by liyang's avatar liyang

fix:ptt debug

parent 5ec5829e
......@@ -59,8 +59,14 @@ def reptile(browser=None, search_word=""):
element_list = browser.find_elements('xpath', "//div[@class='r-ent']//div[@class='title']//a")
length_two = len(element_list)
for index_two in range(length_two):
log.debug(f"正在爬取分类:{type_title}-第{index_two + 1}条")
# print(element_list[index_two].text)
try:
re.findall("公告", element_list[index_two].text)
except:
log.debug(f"正在爬取分类:{type_title}-第{index_two + 1}条")
print(element_list[index_two].get_attribute("outerHTML"))
print("出现错误:")
# 标题不包含"公告"和"看板"
if re.findall("公告", element_list[index_two].text) or re.findall("看板", element_list[index_two].text):
a = 1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment