use selenium chromedriver to extract information from a website in Python

Опубликовано: 12 Декабрь 2016
на канале: The American Developer
6,299
103

Take a seat and enjoy some serious python selenium programming done by the one and only American Developer!

If anyone had difficulty with how to use google developer console here is a link that can explains how to use it:
https://developers.google.com/web/too...

Or... if you would like me to create a video about how to use the google chrome developer console, I would be more than happy to make one!

This video covers simple selenium code that will allow you to extract all ticket price information from a website.

As you may have noticed, I did use the xpath call "//*" which simply means everything within a given part of the DOM.

This is how I have been able to use selenium on dynamically based webpages like gmail. This is just a sample of it from the video:

parentTab = self.driver.find_element_by_id('flightModuleList')
for selectAll in parentTab.find_elements_by_xpath("//*"):
if selectAll.get_attribute("class") == 'dollars price-emphasis':
print selectAll.get_attribute("class")
print selectAll.text

The following concepts are being used in this python tutorial:
for loops
class
object usage
functions
variable declarations
selenium function and class calls
time.sleep
chromedriver




selenium selenium selenium selenium
selenium
selenium
selenium
selenium
selenium
python
python
python
python
python
python