Aug-05-2021, 09:02 AM
Hi all,
In attempting to challenge myself extracting different objects with webscraping and Beautifulsoup, I've come across a small problem that I bet is easy to fix- but I have no idea what to search for in google to find the solution.
If an object has two words, for example in this code:
I tried doing something like:
Could someone please enlighten me how to deal with an object that has a space between two or more words please?
Thanks a lot.
In attempting to challenge myself extracting different objects with webscraping and Beautifulsoup, I've come across a small problem that I bet is easy to fix- but I have no idea what to search for in google to find the solution.
If an object has two words, for example in this code:
tag = item.find('div', {'class': 'tagger expired'})when running the code, I get:
Output:None
I've figured out that it's not referencing the 'tagger expired' because it's two words. If the object was one word, like 'tagger' or 'expired', it would run fine. I tried doing something like:
tag = item.find('div', {'class': 'tagger%expired'})but that returns 'None' also.
Could someone please enlighten me how to deal with an object that has a space between two or more words please?
Thanks a lot.