I have an issue with Python control flow.Below is the scenario i'm trying get some data from a webpage using selenium.
Here is a sample part of the code that i'm using.I'm taking the list of URL's from database. So for each URL the chrome browser(same browser) will be opened and search for the URL page which is passed.
If there is nothing or no details on the URL page , ie when variable "length" is zero , i have modified the URL value by adding 'sell' to the URL and now i want to break the execution of the program and pass this new URL to "browser.get(url)" here without taking the next element from for loop.
for row in urls:
url=str(row)
browser.get(url)
names = browser.find_elements_by_xpath("//span[@class='pymv4e']")
product = [x.text for x in names]
filtered = [x for x in product if len(x.strip()) > 0]
length=(len(filtered))
if length ==0 :
url=url+ '+sell'
filtered, where is it from? MVCE