Skip to content

Commit

Permalink
debug,打印窗口 html
Browse files Browse the repository at this point in the history
  • Loading branch information
Lemoncchi committed Jan 11, 2025
1 parent abbba6b commit 8bb93f6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion get_url.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,13 @@ def get_crt_time() -> str:

def select_elements():
'''选出后续需要使用的元素'''
from selenium.common.exceptions import NoSuchElementException

search_box = driver.find_element("xpath",r'/html/body/div[1]/div/div[2]/div/table/thead/tr/th[3]/input')
try:
search_box = driver.find_element("xpath",r'/html/body/div[1]/div/div[2]/div/table/thead/tr/th[3]/input')
except NoSuchElementException:
# 打印窗口 html
print(driver.page_source)

search_box.send_keys('CUC\n')

Expand Down

0 comments on commit 8bb93f6

Please sign in to comment.