I was trying to web scrape data from a website but with no success.
I have run tests in the terminal and I seem to have no problem with running a for loop to print one list. The problem comes when I try to use 2 variables in a for loop.
I have tried to use zip
but it doesn't seem to be working. Since I didn't know about how to use zip, I have checked other pages in StackOverflow but nothing seems to be working with my case.
This is the code I came up with:
browser = webdriver.Chrome("C:\webdrivers\chromedriver.exe")
browser.get("https://www.worldometers.info/coronavirus/")
countries = browser.find_elements_by_tag_name("mt_a")
cases = browser.find_elements_by_tag_name("sorting_1")
[print(i.text, '-', j.text) for i, j in zip(countries, cases)]
When I tried running the program both from my IDE and terminal, nothing happened. Can anyone please help me solve this issue? All help appericiated.