Here is a description of what I am trying to do using Selenium Webdriver in Python: I have my website which takes as input various parameters for a specific product and outputs a price for the product with those parameters. I am keeping all but one parameters constant and varying one specific parameter in a for loop to see how the price varies according to that one specific parameter. Once i change the parameter i submit the form and then i use implicitly wait as follows:
submit_btn.click()
driver.implicitly_wait(10)
driver.find_element_by_name("Buy_Product")
soup=BeautifulSoup(driver.page_source)
When entering the first set of parameters the page is clear and it does not contain the buttton with name "Buy_Product" so i am using the line
driver.find_element_by_name("Buy_Product")
to make sure the code waits for that button to appear which will mean the page now contains the price i want to extract. The problem is that the second time through the loop when i vary the parameter and try to get the new price the button "Buy_Product" is already there so implicitly wait does not work anymore and sometimes it will take the previous page_source before the price has time to be updated. The tricky part is that sometimes even for different parameters the price is the same so i can not just check whether the visible text of the price has changed. Any ideas how this can be solved without using time.sleep?