Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Selenium in Python

Sponsored · Your Podcast. Everywhere. Effortlessly. Share. Educate. Inspire. Entertain. You do you. We'll handle the rest. →
Avatar for NYC PyLadies NYC PyLadies
May 25, 2014
69

Selenium in Python

Presented by Christie Ewen at NYC PyLadies event hosted at Flatiron Health: http://www.meetup.com/NYC-PyLadies/events/175278962/

Avatar for NYC PyLadies

NYC PyLadies

May 25, 2014

Transcript

  1. Why Selenium? • WYSIWYG What You See Is What You

    Get • Cross Browser testing • Web scraping / automation • For the example I’m going to show you, you don’t need to know the internals of Wordpress especially out-of-the-box websites
  2. How to get started • https://www.youtube.com/watch? v=52wxGESwQSA • Install Selenium

    ◦ “pip install selenium” • “from selenium import webdriver” • Play with sample code ◦ https://github.com/paulproteus/python-scraping- code-samples
  3. Problems: • Errors • Can’t find element • Install Chromedriver

    • Set env variables ◦ driver = webdriver.Chrome(executable_path=" /path/to/chromedriver") • Experiment with Firefox and Chrome to inspect HTML element Solutions: