我正在使用python的模块“ google”,并且我想解析链接上方的精选代码段。
现在,我有以下代码:
from google import google
num_page = 1
search_results = google.search("ally subsidiaries", num_page)
for result in search_results:
print(result.name)
示例:
ally finance
如何解析链接上方表格中的数据? (表中的盟友财务->子公司)
我的代码仅向我提供了精选代码段下方的链接。
答案 0 :(得分:0)
您实际上是在尝试从以上featured snippet(搜索结果上方的表)中提取数据。不幸的是,谷歌包没有为此提供解决方案。
您可以尝试使用此api。 SERP API确实非常快,并且提供了许多功能,例如从精选片段中提取数据。
尝试以下API请求并查看结果。
https://serpapi.com/search.json?q=ally+subsidiaries&location=United+States&hl=en&gl=us&source=homepage&async=true
您可以检查响应here。
"subsidiaries": [
{
"name": "Ally Invest",
"link": "https://www.google.com/search?hl=en&gl=us&q=Ally+Invest&stick=H4sIAAAAAAAAAONgFuLUz9U3MEvJLchW4gIxjdPTy8uytTQzyq30k_NzclKTSzLz8_Tzi9IT8zKrEkGcYqvi0qTizJTMxKLM1OJHjEncAi9_3BOWipy05uQ1xmAu4vUKqXGxueaVZJZUCslw8Uoh3KLBIMXNheDyAAApWMzDqQAAAA&sa=X&ved=0ahUKEwj0uc-slKffAhU8HjQIHUQbAm4Qri4IKg",
"image": "data:image/gif;base64,R0lGODlhAQABAIAAAP///////yH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="
},
{
"name": "Ally Bank",
"link": "https://www.google.com/search?hl=en&gl=us&q=Ally+Bank&stick=H4sIAAAAAAAAAONgFuLUz9U3MEvJLchW4gIxLQySKitStDQzyq30k_NzclKTSzLz8_Tzi9IT8zKrEkGcYqvi0qTizJTMxKLM1OJHjEncAi9_3BOWipy05uQ1xmAu4vUKqXGxueaVZJZUCslw8Uoh3KLBIMXNheDyAACaSL6bqQAAAA&sa=X&ved=0ahUKEwj0uc-slKffAhU8HjQIHUQbAm4Qri4ILQ",
"image": "data:image/gif;base64,R0lGODlhAQABAIAAAP///////yH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="
},
{
"name": "Clearlane",
"link": "https://www.google.com/search?hl=en&gl=us&q=Clearlane&stick=H4sIAAAAAAAAAONgFuLUz9U3MEvJLchW4tVP1zc0TDZNMs_JyEvR0swot9JPzs_JSU0uyczP088vSk_My6xKBHGKrYpLk4ozUzITizJTix8xJnELvPxxT1gqctKak9cYg7mI1yukxsXmmleSWVIpJMPFK4VwjgaDFDcXgssDAH24WVGsAAAA&sa=X&ved=0ahUKEwj0uc-slKffAhU8HjQIHUQbAm4Qri4IMA"
},
{
"name": "Semperian LLC",
"link": "https://www.google.com/search?hl=en&gl=us&q=Semperian+LLC&stick=H4sIAAAAAAAAAONgFuLUz9U3MEvJLchW4gIxLXOTC5IKtDQzyq30k_NzclKTSzLz8_Tzi9IT8zKrEkGcYqvi0qTizJTMxKLM1OJHjEncAi9_3BOWipy05uQ1xmAu4vUKqXGxueaVZJZUCslw8Uoh3KLBIMXNheDyAACwnQHDqQAAAA&sa=X&ved=0ahUKEwj0uc-slKffAhU8HjQIHUQbAm4Qri4IMg"
},
{
"name": "Residential Funding Securities, LLC",
"link": "https://www.google.com/search?hl=en&gl=us&q=Residential+Funding+Securities,+LLC&stick=H4sIAAAAAAAAAONgFuLUz9U3MEvJLchW4gIxLXOzUlIKtTQzyq30k_NzclKTSzLz8_Tzi9IT8zKrEkGcYqvi0qTizJTMxKLM1OJHjEncAi9_3BOWipy05uQ1xmAu4vUKqXGxueaVZJZUCslw8Uoh3KLBIMXNheDyAACYUeyGqQAAAA&sa=X&ved=0ahUKEwj0uc-slKffAhU8HjQIHUQbAm4Qri4INA"
},
{
"name": "Ally Investment Management LLC",
"link": "https://www.google.com/search?hl=en&gl=us&q=Ally+Investment+Management+LLC&stick=H4sIAAAAAAAAAONgFuLUz9U3MEvJLchW4tVP1zc0TC42MyzMsDDV0swot9JPzs_JSU0uyczP088vSk_My6xKBHGKrYpLk4ozUzITizJTix8xJnELvPxxT1gqctKak9cYg7mI1yukxsXmmleSWVIpJMPFK4VwjgaDFDcXgssDAJxppVKsAAAA&sa=X&ved=0ahUKEwj0uc-slKffAhU8HjQIHUQbAm4Qri4INg"
},
{
"name": "CAPITAL AUTO RECEIVABLES INC",
"link": "https://www.google.com/search?hl=en&gl=us&q=CAPITAL+AUTO+RECEIVABLES+INC&stick=H4sIAAAAAAAAAONgFuLUz9U3MEvJLchW4gIxLXON49MztDQzyq30k_NzclKTSzLz8_Tzi9IT8zKrEkGcYqvi0qTizJTMxKLM1OJHjEncAi9_3BOWipy05uQ1xmAu4vUKqXGxueaVZJZUCslw8Uoh3KLBIMXNheDyAAAiZJBnqQAAAA&sa=X&ved=0ahUKEwj0uc-slKffAhU8HjQIHUQbAm4Qri4IOA"
},
{
"name": "RFC Investments Limited",
"link": "https://www.google.com/search?hl=en&gl=us&q=RFC+Investments+Limited&stick=H4sIAAAAAAAAAONgFuLUz9U3MEvJLchW4tVP1zc0TC42M443syzT0swot9JPzs_JSU0uyczP088vSk_My6xKBHGKrYpLk4ozUzITizJTix8xJnELvPxxT1gqctKak9cYg7mI1yukxsXmmleSWVIpJMPFK4VwjgaDFDcXgssDAB0iIZasAAAA&sa=X&ved=0ahUKEwj0uc-slKffAhU8HjQIHUQbAm4Qri4IOg"
},
{
"name": "RESIDENTIAL FUNDING MORTGAGE SECURITIES I INC",
"link": "https://www.google.com/search?hl=en&gl=us&q=RESIDENTIAL+FUNDING+MORTGAGE+SECURITIES+I+INC&stick=H4sIAAAAAAAAAONgFuLUz9U3MEvJLchW4gIxLXOLisyTtTQzyq30k_NzclKTSzLz8_Tzi9IT8zKrEkGcYqvi0qTizJTMxKLM1OJHjEncAi9_3BOWipy05uQ1xmAu4vUKqXGxueaVZJZUCslw8Uoh3KLBIMXNheDyAACqUeI6qQAAAA&sa=X&ved=0ahUKEwj0uc-slKffAhU8HjQIHUQbAm4Qri4IPA"
},
{
"name": "IB Finance Holding Co LLC",
"link": "https://www.google.com/search?hl=en&gl=us&q=IB+Finance+Holding+Co+LLC&stick=H4sIAAAAAAAAAONgFuLUz9U3MEvJLchW4gIxLXPNMowKtTQzyq30k_NzclKTSzLz8_Tzi9IT8zKrEkGcYqvi0qTizJTMxKLM1OJHjEncAi9_3BOWipy05uQ1xmAu4vUKqXGxueaVZJZUCslw8Uoh3KLBIMXNheDyAADGY9GhqQAAAA&sa=X&ved=0ahUKEwj0uc-slKffAhU8HjQIHUQbAm4Qri4IPg"
},
{
"name": "GMACI Holdings LLC",
"link": "https://www.google.com/search?hl=en&gl=us&q=GMACI+Holdings+LLC&stick=H4sIAAAAAAAAAONgFuLUz9U3MEvJLchW4gIxLXOzynNytTQzyq30k_NzclKTSzLz8_Tzi9IT8zKrEkGcYqvi0qTizJTMxKLM1OJHjEncAi9_3BOWipy05uQ1xmAu4vUKqXGxueaVZJZUCslw8Uoh3KLBIMXNheDyAADiMsYiqQAAAA&sa=X&ved=0ahUKEwj0uc-slKffAhU8HjQIHUQbAm4Qri4IQA"
},
{
"name": "Basic Credit Holding Company, L.L.C.",
"link": "https://www.google.com/search?hl=en&gl=us&q=Basic+Credit+Holding+Company,+L.L.C.&stick=H4sIAAAAAAAAAONgFuLUz9U3MEvJLchW4gIxLXPNy8vytDQzyq30k_NzclKTSzLz8_Tzi9IT8zKrEkGcYqvi0qTizJTMxKLM1OJHjEncAi9_3BOWipy05uQ1xmAu4vUKqXGxueaVZJZUCslw8Uoh3KLBIMXNheDyAADil2z5qQAAAA&sa=X&ved=0ahUKEwj0uc-slKffAhU8HjQIHUQbAm4Qri4IQg"
},
{
"name": "TradeKing Group, Inc.",
"link": "https://www.google.com/search?hl=en&gl=us&q=TradeKing+Group,+Inc.&stick=H4sIAAAAAAAAAONgFuLUz9U3MEvJLchW4tVP1zc0TC42qMqzzDbR0swot9JPzs_JSU0uyczP088vSk_My6xKBHGKrYpLk4ozUzITizJTix8xJnELvPxxT1gqctKak9cYg7mI1yukxsXmmleSWVIpJMPFK4VwjgaDFDcXgssDAF22fRmsAAAA&sa=X&ved=0ahUKEwj0uc-slKffAhU8HjQIHUQbAm4Qri4IRA"
},
{
"name": "Ally US LLC",
"link": "https://www.google.com/search?hl=en&gl=us&q=Ally+US+LLC&stick=H4sIAAAAAAAAAONgFuLUz9U3MEvJLchW4tVP1zc0TC42M67MMTbT0swot9JPzs_JSU0uyczP088vSk_My6xKBHGKrYpLk4ozUzITizJTix8xJnELvPxxT1gqctKak9cYg7mI1yukxsXmmleSWVIpJMPFK4VwjgaDFDcXgssDAPsUSVCsAAAA&sa=X&ved=0ahUKEwj0uc-slKffAhU8HjQIHUQbAm4Qri4IRg"
},
{
"name": "Central Originating Lease Trust II",
"link": "https://www.google.com/search?hl=en&gl=us&q=Central+Originating+Lease+Trust+II&stick=H4sIAAAAAAAAAONgFuLUz9U3MEvJLchW4tVP1zc0TDassDCqyC7R0swot9JPzs_JSU0uyczP088vSk_My6xKBHGKrYpLk4ozUzITizJTix8xJnELvPxxT1gqctKak9cYg7mI1yukxsXmmleSWVIpJMPFK4VwjgaDFDcXgssDAAU1HSmsAAAA&sa=X&ved=0ahUKEwj0uc-slKffAhU8HjQIHUQbAm4Qri4ISA"
},
{
"name": "Residential Funding Mortgage Securities II, Inc",
"link": "https://www.google.com/search?hl=en&gl=us&q=Residential+Funding+Mortgage+Securities+II,+Inc&stick=H4sIAAAAAAAAAONgFuLUz9U3MEvJLchW4gIxLXPLkgqrtDQzyq30k_NzclKTSzLz8_Tzi9IT8zKrEkGcYqvi0qTizJTMxKLM1OJHjEncAi9_3BOWipy05uQ1xmAu4vUKqXGxueaVZJZUCslw8Uoh3KLBIMXNheDyAACSuemUqQAAAA&sa=X&ved=0ahUKEwj0uc-slKffAhU8HjQIHUQbAm4Qri4ISg"
},
{
"name": "Central Originating Lease LLC",
"link": "https://www.google.com/search?hl=en&gl=us&q=Central+Originating+Lease+LLC&stick=H4sIAAAAAAAAAONgFuLUz9U3MEvJLchW4gIxLfOMCowstTQzyq30k_NzclKTSzLz8_Tzi9IT8zKrEkGcYqvi0qTizJTMxKLM1OJHjEncAi9_3BOWipy05uQ1xmAu4vUKqXGxueaVZJZUCslw8Uoh3KLBIMXNheDyAACGfHNzqQAAAA&sa=X&ved=0ahUKEwj0uc-slKffAhU8HjQIHUQbAm4Qri4ITA"
},
{
"name": "Master Lease Austria GmbH",
"link": "https://www.google.com/search?hl=en&gl=us&q=Master+Lease+Austria+GmbH&stick=H4sIAAAAAAAAAONgFuLUz9U3MEvJLchW4gIxLXOLqgyKtTQzyq30k_NzclKTSzLz8_Tzi9IT8zKrEkGcYqvi0qTizJTMxKLM1OJHjEncAi9_3BOWipy05uQ1xmAu4vUKqXGxueaVZJZUCslw8Uoh3KLBIMXNheDyAABn-hxTqQAAAA&sa=X&ved=0ahUKEwj0uc-slKffAhU8HjQIHUQbAm4Qri4ITg"
},
{
"name": "SA Holding Two LLC",
"link": "https://www.google.com/search?hl=en&gl=us&q=SA+Holding+Two+LLC&stick=H4sIAAAAAAAAAONgFuLUz9U3MEvJLchW4gIxLfNMsrLStDQzyq30k_NzclKTSzLz8_Tzi9IT8zKrEkGcYqvi0qTizJTMxKLM1OJHjEncAi9_3BOWipy05uQ1xmAu4vUKqXGxueaVZJZUCslw8Uoh3KLBIMXNheDyAADY8VGdqQAAAA&sa=X&ved=0ahUKEwj0uc-slKffAhU8HjQIHUQbAm4Qri4IUA"
},
{
"name": "Gamma Auto Receivables LLC",
"link": "https://www.google.com/search?hl=en&gl=us&q=Gamma+Auto+Receivables+LLC&stick=H4sIAAAAAAAAAONgFuLUz9U3MEvJLchW4gIxLfNMDONNtDQzyq30k_NzclKTSzLz8_Tzi9IT8zKrEkGcYqvi0qTizJTMxKLM1OJHjEncAi9_3BOWipy05uQ1xmAu4vUKqXGxueaVZJZUCslw8Uoh3KLBIMXNheDyAABTxDfPqQAAAA&sa=X&ved=0ahUKEwj0uc-slKffAhU8HjQIHUQbAm4Qri4IUg"
},
{
"name": "ResMor Capital Corporation",
"link": "https://www.google.com/search?hl=en&gl=us&q=ResMor+Capital+Corporation&stick=H4sIAAAAAAAAAONgFuLUz9U3MEvJLchW4tVP1zc0TDasMM9JSinU0swot9JPzs_JSU0uyczP088vSk_My6xKBHGKrYpLk4ozUzITizJTix8xJnELvPxxT1gqctKak9cYg7mI1yukxsXmmleSWVIpJMPFK4VwjgaDFDcXgssDADKziX2sAAAA&sa=X&ved=0ahUKEwj0uc-slKffAhU8HjQIHUQbAm4Qri4IVA"
},
{
"name": "SA Holding One LLC",
"link": "https://www.google.com/search?hl=en&gl=us&q=SA+Holding+One+LLC&stick=H4sIAAAAAAAAAONgFuLUz9U3MEvJLchW4gIxLfNM002TtTQzyq30k_NzclKTSzLz8_Tzi9IT8zKrEkGcYqvi0qTizJTMxKLM1OJHjEncAi9_3BOWipy05uQ1xmAu4vUKqXGxueaVZJZUCslw8Uoh3KLBIMXNheDyAABMPqeYqQAAAA&sa=X&ved=0ahUKEwj0uc-slKffAhU8HjQIHUQbAm4Qri4IVg"
},
{
"name": "Pardo Rabello Inversiones S.R.L.",
"link": "https://www.google.com/search?hl=en&gl=us&q=Pardo+Rabello+Inversiones+S.R.L.&stick=H4sIAAAAAAAAAONgFuLUz9U3MEvJLchW4gIxLXMzKi0LtTQzyq30k_NzclKTSzLz8_Tzi9IT8zKrEkGcYqvi0qTizJTMxKLM1OJHjEncAi9_3BOWipy05uQ1xmAu4vUKqXGxueaVZJZUCslw8Uoh3KLBIMXNheDyAAAkpI8NqQAAAA&sa=X&ved=0ahUKEwj0uc-slKffAhU8HjQIHUQbAm4Qri4IWA"
},
{
"name": "GM Credit AB",
"link": "https://www.google.com/search?hl=en&gl=us&q=GM+Credit+AB&stick=H4sIAAAAAAAAAONgFuLUz9U3MEvJLchW4gIxLXMr8kqytDQzyq30k_NzclKTSzLz8_Tzi9IT8zKrEkGcYqvi0qTizJTMxKLM1OJHjEncAi9_3BOWipy05uQ1xmAu4vUKqXGxueaVZJZUCslw8Uoh3KLBIMXNheDyAADOUKgMqQAAAA&sa=X&ved=0ahUKEwj0uc-slKffAhU8HjQIHUQbAm4Qri4IWg"
},
{
"name": "Banco GMAC SA",
"link": "https://www.google.com/search?hl=en&gl=us&q=Banco+GMAC+SA&stick=H4sIAAAAAAAAAONgFuLUz9U3MEvJLchW4gIxLXPjK4qytTQzyq30k_NzclKTSzLz8_Tzi9IT8zKrEkGcYqvi0qTizJTMxKLM1OJHjEncAi9_3BOWipy05uQ1xmAu4vUKqXGxueaVZJZUCslw8Uoh3KLBIMXNheDyAAAscRtsqQAAAA&sa=X&ved=0ahUKEwj0uc-slKffAhU8HjQIHUQbAm4Qri4IXA"
},
{
"name": "OVD GmbH",
"link": "https://www.google.com/search?hl=en&gl=us&q=OVD+GmbH&stick=H4sIAAAAAAAAAONgFuLUz9U3MEvJLchW4tVP1zc0TDZNsjAvSC_S0swot9JPzs_JSU0uyczP088vSk_My6xKBHGKrYpLk4ozUzITizJTix8xJnELvPxxT1gqctKak9cYg7mI1yukxsXmmleSWVIpJMPFK4VwjgaDFDcXgssDAImSjuqsAAAA&sa=X&ved=0ahUKEwj0uc-slKffAhU8HjQIHUQbAm4Qri4IXg"
},
{
"name": "Canadian Securitized Auto Receivables Corp.",
"link": "https://www.google.com/search?hl=en&gl=us&q=Canadian+Securitized+Auto+Receivables+Corp.&stick=H4sIAAAAAAAAAONgFuLUz9U3MEvJLchW4tVP1zc0TDasMDVIMk7W0swot9JPzs_JSU0uyczP088vSk_My6xKBHGKrYpLk4ozUzITizJTix8xJnELvPxxT1gqctKak9cYg7mI1yukxsXmmleSWVIpJMPFK4VwjgaDFDcXgssDAPA13dCsAAAA&sa=X&ved=0ahUKEwj0uc-slKffAhU8HjQIHUQbAm4Qri4IYA"
},
{
"name": "Ally Financial Inc., Asset Management Arm",
"link": "https://www.google.com/search?hl=en&gl=us&q=Ally+Financial+Inc.,+Asset+Management+Arm&stick=H4sIAAAAAAAAAONgFuLUz9U3MEvJLchW4tVP1zc0TC42Myw3KkrT0swot9JPzs_JSU0uyczP088vSk_My6xKBHGKrYpLk4ozUzITizJTix8xJnELvPxxT1gqctKak9cYg7mI1yukxsXmmleSWVIpJMPFK4VwjgaDFDcXgssDAFWurRmsAAAA&sa=X&ved=0ahUKEwj0uc-slKffAhU8HjQIHUQbAm4Qri4IYg"
},
{
"name": "WHOLESALE AUTO RECEIVABLES LLC",
"link": "https://www.google.com/search?hl=en&gl=us&q=WHOLESALE+AUTO+RECEIVABLES+LLC&stick=H4sIAAAAAAAAAONgFuLUz9U3MEvJLchW4gIxLXNN0gsttTQzyq30k_NzclKTSzLz8_Tzi9IT8zKrEkGcYqvi0qTizJTMxKLM1OJHjEncAi9_3BOWipy05uQ1xmAu4vUKqXGxueaVZJZUCslw8Uoh3KLBIMXNheDyAACT1_oJqQAAAA&sa=X&ved=0ahUKEwj0uc-slKffAhU8HjQIHUQbAm4Qri4IZA"
},
{
"name": "Variable Asset Receivables LLC",
"link": "https://www.google.com/search?hl=en&gl=us&q=Variable+Asset+Receivables+LLC&stick=H4sIAAAAAAAAAONgFuLUz9U3MEvJLchW4gIxLXMNysoMtDQzyq30k_NzclKTSzLz8_Tzi9IT8zKrEkGcYqvi0qTizJTMxKLM1OJHjEncAi9_3BOWipy05uQ1xmAu4vUKqXGxueaVZJZUCslw8Uoh3KLBIMXNheDyAAAPX9v1qQAAAA&sa=X&ved=0ahUKEwj0uc-slKffAhU8HjQIHUQbAm4Qri4IZg"
},
{
"name": "Colonial Mortgage Service Company",
"link": "https://www.google.com/search?hl=en&gl=us&q=Colonial+Mortgage+Service+Company&stick=H4sIAAAAAAAAAONgFuLUz9U3MEvJLchW4tVP1zc0TDasMM22rIrX0swot9JPzs_JSU0uyczP088vSk_My6xKBHGKrYpLk4ozUzITizJTix8xJnELvPxxT1gqctKak9cYg7mI1yukxsXmmleSWVIpJMPFK4VwjgaDFDcXgssDAMSyuWGsAAAA&sa=X&ved=0ahUKEwj0uc-slKffAhU8HjQIHUQbAm4Qri4IaA"
}
]