[英]Scraping this type of site architecture possible?
我正在嘗試為客戶構建Web應用程序。 它在此站點上實現了一個簡單的遠程搜索:
https://www.handelsregister.de/rp_web/mask.do?Typ=n
我需要做的就是在標記為Company or keywords
的輸入字段中插入一些值,執行搜索並獲取HTTP響應。
問題是我對這種架構不熟悉。 我一直使用具有URL等的API。是否可以通過編程自動執行上述操作?
大概。 您可以發送POST請求並解析響應。 這是Python中帶有模塊requests
的基本示例:
import requests
query = "test"
post_fields = {'suchTyp':'n',
'registerArt':'',
'registerNummer':'',
'registergericht':'',
'schlagwoerter':query,
'schlagwortOptionen':2,
'ergebnisseProSeite':100,
'btnSuche':'Rechercher'}
response = requests.post("https://www.handelsregister.de/rp_web/search.do", data=post_fields)
print(response.status_code)
print(response.text)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.