python - 如何在 python 中获取 Google 之类的 url 摘录
问题描述
我写了这样的代码:
#pip3 install google
from googlesearch import search
query = 'java'
for i in search(query, # The query you want to run
tld = 'com', # The top level domain
lang = 'en', # The language
num = 10, # Number of results per page
start = 0, # First result to retrieve
stop = None, # Last result to retrieve
pause = 0, # Lapse between HTTP requests
safe = 'high'
):
print(i)
解决方案
我认为使用包是不可能的,但是如果你requests
在 python 上使用模块和一些网络抓取库(beautifulsoup<meta name="description" content="google description">
),你可以使用 HTML 标签( )获取这些描述
推荐阅读
- python - http流感季节问题python不确定为什么我得到这个输出
- html - Hover effect on image with text
- simulink - Simulink 中的 FMI 协同仿真运行时错误
- typescript - Typescript extended types declaration
- json - Azure ARM Template different Resource Group Dependency Issue
- ruby-on-rails - 在新的 AWS Cloud 9 IDE 中停止 Rails 服务器
- sapui5 - SAP Cloud Platform 与 SAPUI5 的关系?
- python - Python Pandas 使用基于另一个具有重叠索引的数据框中的列的值更新数据框列
- reactjs - 在反应文本组件中动态设置字体大小
- java - 将文件从 android 设备传输到 android studio