Skip to content

Instantly share code, notes, and snippets.

View helloasir's full-sized avatar

helloasir helloasir

View GitHub Profile
@helloasir
helloasir / Selenium.Python.InjectJS.py
Created January 9, 2020 11:25 — forked from anhldbk/Selenium.Python.InjectJS.py
Inject jQuery into Selenium Driver
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')")