Consider the following page: https://www.cvs.com/shop/advil-pain-reliever-fever-reducer-ibuprofen-tablets-200mg-prodid-1040240?skuid=420321
When selecting a different format, like 100 CT, a new price shows up. Copy that URL and navigate to it, notice that it redirects back to the original 10 CT page.
I want to get the price of what's on the 100 CT page.
Here is my code, which clicks the right format, but when I try to reobtain the url I still get the 10 CT page.
format_header = browser.find_element_by_css_selector("ul.--horizontalScroll.gbcvs-c-variantSelectorList")
items = format_header.find_elements_by_tag_name('li')
format_count = 1
for item in items:
text = item.text
if(text == '100 CT'):
break
else:
format_count += 1
browser.find_element_by_xpath("(.//*[normalize-space(text()) and normalize-space(.)='Count:'])[1]/following::label["+str(format_count)+"]").click()
print(browser.current_url)
browser.get(browser.current_url)
