我試圖使用python requests
模塊通過單擊分析來從this網站獲取某些查詢DNA序列的解鏈溫度。我正在使用下面的代碼。Python請求內容不包含響應
import requests
referer = "http://sg.idtdna.com/calc/analyzer"
data = {"settings":{"Sequence":"GGGGGGGAAAAAAGGGGGG","NaConc":50,"MgConc":0,"DNTPsConc":0,"OligoConc":0.25,"NucleotideType":"DNA"}}
r = requests.post(referer, params=data)
print r.content
然而,「熔化溫度」等各個領域都在響應的r.content
空白。儘管Chrome檢查中名爲「分析」的「響應」標籤中包含我所追求的內容。
查看檢查的元素在這裏。
如果我瀏覽上面的圖像的響應選項卡,我發現其中含有正好我之後的信息如下。
{"Sequence":"GGG GGG GAA AAA AGG GGG G","NaConc":50,"MgConc":0,"dNTPsConc":0,"Complement":"CCC CCC TTT TTT CCC CCC C","Length":19,"GCContent":68.4,"MeltTemp":61.4,"MolecularWeight":6097,"ExtCoefficient":205900,"NmoleOD":4.86,"UgOD":29.61,"NucleotideType":"DNA","OligoConc":0.25,"HasErrors":false,"HasModelErrors":false,"ModelErrors":null,"MinMeltTemp":0,"MaxMeltTemp":0,"Mods":[{"ExtensionData":{},"IntProductId":1012,"ProductName":"DNA","ProductType":0,"PublishedProductNbr":1012,"ShortName":"","TotalProductCount":19}],"Errors":[]}
這個特定的查詢應該給的61.4度的 「熔化溫度」。 – henneray
'requests.post(...'**不是** _ **點擊** _。有一些'javascript'響應點擊。 – stovfl
好點!我已經更新上面。是一個名稱('analyze'),它是一個提供相關信息的'post'請求。我可以在哪裏找到/請求javascript的點擊? – henneray