擅长:python、mysql、java
<p>我建议使用像BeautifulSoup这样的东西来针对包含结果的URL的HTML元素。然后,你可以储存网址,并做你喜欢的。你知道吗</p>
<pre><code>import requests
from bs4 import BeautifulSoup
query = 'hello world'
url = 'http://google.com/search?q=' + query
page = requests.get(url)
soup = BeautifulSoup(page.text, 'html.parser')
for link in soup.find_all('a'):
print(link.get('href'))
</code></pre>