What is this error?

'NoneType' object has no attribute 'text'
earlier run.
code:
tomsk = "https://yandex.ru/search/?text=%D0%BF%D0%BE%D0%B3%D0%BE%D0%B4%D0%B0%20%D0%B2%20%D1%82%D0%BE%D0%BC%D1%81%D0%BA%D0%B5&lr=67"
full_page_tomsk = requests.get(tomsk)
soup_tomsk = BeautifulSoup(full_page_tomsk.content, "html.parser")
div_tomsk = soup_tomsk.find('div', {"class":"weather-forecast__current-temp"})
print(div_tomsk.text)
April 19th 20 at 12:18
2 answers
April 19th 20 at 12:20
Solution
Variable div_tomsk empty.
no
soup_tomsk.find('div', {"class":"weather-forecast__current-temp"}) - miracle_Armstrong99 commented on April 19th 20 at 12:23
@miracle_Armstrong99, @miracle_Armstrong99, before that everything worked and the screen displayed - miracle_Armstrong99 commented on April 19th 20 at 12:26
@miracle_Armstrong99, Yes, soup, nothing was found and returned None - reece.Sanford commented on April 19th 20 at 12:29
@reece.Sanford, well, and how to fix it?? need to display weather in Tomsk at the moment - miracle_Armstrong99 commented on April 19th 20 at 12:32
@miracle_Armstrong99, let's plug head and think for yourself - reece.Sanford commented on April 19th 20 at 12:35
@miracle_Armstrong99, change the search target. - Lou77 commented on April 19th 20 at 12:38
April 19th 20 at 12:22
In this method the url for requests.get() triggers protection programs-robots.
1. Try before executing requests.get() Requests to fill the data Headers, which sends, for example, Chrome when accessing the Yandex.
2. Change url that is designed to search for information about the weather in Tomsk, on "https://yandex.ru/pogoda/tomsk" and, of course, the parameters for the selection of temperature.
3. If the lock will be triggered, we suggest to use the module silenium (controlling the browser from your program)

Find more questions by tags Beautiful SoupPython