I wrote the following code:
driver = webdriver.Firefox()
driver.get('https://www.ybpn.de/ihre-parfuemerien/')
search_elem = driver.find_element_by_id("search_input") # Find search form
search_elem.send_keys("80331") # Enter zip code - later based on a .txt of zip codes
submit_button = driver.find_element_by_name("tx_ybpn_storefinder[submit]").submit() # press "submit" button, search
Selenium opens the url, search for the "input field", enter a zip code and press submit.
Now I want to search the "new page" (after the action from the code above) for specific data with bs4.
Normally I would use the following code:
url = ("https://www.ybpn.de/ihre-parfuemerien/")
page = requests.get(url)
soup = BeautifulSoup(page.text, features="html.parser")
Problem: When I use the "normal" url it loads the dynamic map without the data I need. The page doesnt create a unique url after I performed the search with selenium. It only adds a specific cHash-value at the end of the url, but when I connect with this url, Im redirected to the "normal page" - there is no url that loads the page with my search results.
Question: How can I get a specific url or create a variable after the "search for specific zip code"-action to search with bs4 for the data I need?
I really hope its understandable what I mean! Thank you!