I am using the find function to retrieve this object:
<h1 data-testid=“organization-cover-title” class=“sc-1wcv2gl-2 kpUYKd”>Company</h1>
With this code below, it returns a NoneType
company = soup.find(‘h1’, attrs = {‘data-testid’:‘organization-cover-title’, ‘class’:‘sc-1wcv2gl-2 kpUYKd’}).string
It also does not return a string with one or the other attribute.
Would you be so kind as to find a solution?
Thanks
2
Answers
The code was right actually. It works
Your example is using curly quotes in HTML and CODE that are the quotation marks used in good typography.
You have to use the straight single quote (‘) or the straight double quote (") to get it working in both HTML and CODE.