【发布时间】:2020-01-31 09:36:54
【问题描述】:
我想从我的拼贴结果网站收集学生的结果数据 - http://www.bietjhs.ac.in/result2019/GetResult.aspx
为此,我使用了 python 中的 requests 模块
import requests
from bs4 import BeautifulSoup
url = 'http://www.bietjhs.ac.in/result2019/Result.aspx'
values = {'__VIEWSTATE':'/wEPDwULLTEwMTgxNzc0MDlkZPl3fGYoB3mixdEklq4qolYFT0kX',
'__VIEWSTATEGENERATOR':'83531E22',
'__EVENTVALIDATION':'/wEWAwL1j+SrAgK097CQBgLCi9reAwX5Exu+9wGq1/SB++dfh19a1B4s',
'txtRollNo':'1804310063'}
respond = requests.post(url = url,data = values)
soup = BeautifulSoup(respond.content,features='html.parser')
print(soup.text)
我的代码解释成功,但网站响应运行时错误。
运行时错误\'/result2019\' 应用程序中的服务器错误。
运行时错误
说明:服务器上出现应用程序错误。此应用程序的当前自定义错误设置阻止远程查看应用程序错误的详细信息(出于安全原因)。但是,它可以被本地服务器机器上运行的浏览器查看。详细信息:启用此特定错误消息的详细信息 要在远程机器上查看,请在“web.config”配置中创建
<!-- Web.Config Configuration File -->
<configuration>
<system.web>
<customErrors mode="Off"/>
</system.web>
</configuration>
</td>
</tr>
</table>
<br>
<b>Notes:</b> The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application\'s <customErrors> configuration tag to point to a custom error page URL.<br><br>
<table width=100% bgcolor="#ffffcc">
<tr>
<td>
<code><pre>
<!-- Web.Config Configuration File -->
<configuration>
<system.web>
<customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
</system.web>
</configuration></pre></code>
</td>
</tr>
</table>
<br>
</body>
</html>
所以,请让我知道我做错了什么。
卷号介于 1804310011 到 1804310064 之间。
【问题讨论】:
标签: selenium web-services web-scraping python-requests