-
Hi guys, I'm building an crawler to get some information's about companies in facebook, and sometimes companies doesn' t have a page in that case I check for specific tag in the DOM. When I did this check:
My expectations was to falls in the except part, log the error and then return my extracted_info variable empty, however the get_text method falls in NoSuchElementException and my except will never be executed. I try another methods from seleniumbase but always falls in the same problem, could someone help me? Thanks, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @acpn , the try/except block should be catching exceptions... which line is the test failing on when you run it? Have you tried using |
Beta Was this translation helpful? Give feedback.
Hi @acpn , the try/except block should be catching exceptions... which line is the test failing on when you run it? Have you tried using
except Exception:
instead? Is it possible that the test failed before it reached this line? SeleniumBase produces screenshots so that you can verify that you're on the correct page. See thelatest_logs/
folder that's created when you run your test. You can also do--html=report.html
to generate an html report, which also has screenshots.