![](/img/trans.png)
[英]How can I access a URL using python requests when the page changes when I request it, even though the parameters are in the URL?
[英]How can I modify part of a url when using Python Requests?
如何在此 URL 中自動增加日期?
reportDate = "https://secure.logmeinrescue.com/API/setReportDate.aspx?bdate=06/25/2015&edate=06/23/2015&authcode=secretAuthcode"
setReportDate = requests.get(reportDate)
requests
沒有任何 URL 編輯功能。 您可以使用urlparse
手動解析 URL,拆分查詢參數,獲取日期並使用datetime
增加它,然后自己重建字符串以將其傳遞回請求。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.