hhh_404.py 590 B

12345678910111213141516171819
  1. from seleniumwire import webdriver # Import from seleniumwire
  2. # Create a new instance of the Chrome driver
  3. driver = webdriver.Chrome()
  4. # Go to the Google home page
  5. driver.get('https://hhh.com.tw/cases/detail/d/12428/')
  6. # Access requests via the `requests` attribute
  7. for request in driver.requests:
  8. if request.response:
  9. if int(request.response.status_code)>=404:
  10. print(
  11. request.url,
  12. request.response.status_code,
  13. request.response.headers['Content-Type']
  14. )
  15. # else:
  16. # print(request.url)