python-webbrowser

soup.select('.r a') in f'https://google.com/search?q={query}' brings back empty list in Python BeautifulSoup. **NOT A DUPLICATE**

半城伤御伤魂 提交于 2019-11-26 17:52:44
问题 The "I'm Feeling Lucky!" project in the "Automate the boring stuff with Python" ebook no longer works with the code he provided. Specifically, the linkElems = soup.select('.r a') I've already tried using the solution provided in: soup.select('.r a') in 'https://www.google.com/#q=vigilante+mic' gives empty list in python BeautifulSoup , and I'm currently using the same search format. import webbrowser, requests, bs4 def im_feeling_lucky(): # Make search query look like Google's search = '+'