Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save MITsVision/50b4ca3ec700eaec96cb63590882bbd6 to your computer and use it in GitHub Desktop.

Select an option

Save MITsVision/50b4ca3ec700eaec96cb63590882bbd6 to your computer and use it in GitHub Desktop.

Revisions

  1. @anhldbk anhldbk revised this gist Oct 1, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Selenium.Python.InjectJS.py
    Original file line number Diff line number Diff line change
    @@ -2,7 +2,7 @@
    driver = webdriver.Firefox()
    driver.get('https://www.facebook.com/')

    with open(jquery-1.9.1.min.js’, ‘r) as jquery_js:
    with open('jquery-1.9.1.min.js', 'r') as jquery_js:
    jquery = jquery_js.read() #read the jquery from a file
    driver.execute_script(jquery) #active the jquery lib
    driver.execute_script("$('#email').text('anhld')")
  2. @anhldbk anhldbk renamed this gist Oct 1, 2014. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  3. @anhldbk anhldbk created this gist Oct 1, 2014.
    8 changes: 8 additions & 0 deletions Selenium.Python.InjectJS
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,8 @@
    from selenium import webdriver
    driver = webdriver.Firefox()
    driver.get('https://www.facebook.com/')

    with open(‘jquery-1.9.1.min.js’, ‘r’) as jquery_js:
    jquery = jquery_js.read() #read the jquery from a file
    driver.execute_script(jquery) #active the jquery lib
    driver.execute_script("$('#email').text('anhld')")