Below I have setup a script which simply executes a search on a website. The goal is to capture JSON data utilizing Selenium from an event that is fired from an intermediate script, namely the POST request to "https://www.botoxcosmetic.com/sc/api/findclinic/FindSpecialists" as seen in the included image, but without directly sending a request to that URL using Selenium or the requests library. What is the best way to do this, preferably in Python but open to any language?
from selenium import webdriver
base_url = 'https://www.botoxcosmetic.com/women/find-a-botox-cosmetic-specialist'
driver = webdriver.Chrome()
driver.find_element_by_class_name('normalZip').send_keys('10022')
driver.find_element_by_class_name('normalSearch').click()
from Capturing JSON data from intermediate events using Selenium

No comments:
Post a Comment