xtraceback | A verbose Python traceback formatter | Code Quality library
kandi X-RAY | xtraceback Summary
kandi X-RAY | xtraceback Summary
A verbose Python traceback formatter
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Monkey patch os path relpath
- Format the exception message
- Format the exception
- Format filename
- Print exception information
- Factory function for printing
- Return an XTrace instance
- Print an exception
xtraceback Key Features
xtraceback Examples and Code Snippets
Community Discussions
Trending Discussions on xtraceback
QUESTION
I am trying to get a list of email addresses from a website and am very close. The code I have can be seen below. I am getting the following error.
What happens is that there is a page of links which are then clicked on and in the following page there is an email address.
I am trying to print out the email address inside each of the pages after the link is clicked.
Here is an example of a page that the link clicks through to.
xTraceback (most recent call last): File "scrape.py", line 34, in lookup(driver) File "scrape.py", line 26, in lookup emailAdress = driver.find_element_by_xpath('//div[@id="widget-contact"]//a').get_attribute('href') File "/usr/local/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 293, in find_element_by_xpath return self.find_element(by=By.XPATH, value=xpath) File "/usr/local/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 752, in find_element 'value': value})['value'] File "/usr/local/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 236, in execute self.error_handler.check_response(response) File "/usr/local/lib/python2.7/site-packages/selenium/webdriver/remote/errorhandler.py", line 192, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.InvalidSelectorException:
I am using python 2.7.13
.
ANSWER
Answered 2017-Feb-12 at 12:57You just need more precise X-PATH (aslo with calling text method):
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install xtraceback
You can use xtraceback like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page