1

我正在尝试制作一个程序来重新发行我从大学图书馆拿来的书,因为我应该把我的书USER-ID放在表格中并提交,然后做剩下的代码。但我什至无法获取列出我所有书籍的页面,TypeError当我尝试打印列出我的书籍的页面的内容时,我得到了。

这是整个追溯。

Traceback (most recent call last):
  File "C:/Users/User/PycharmProjects/dictionary/reissue.py", line 43, in 
<module>
    sign_up['txtmemberid'].value = 'user-id'
TypeError: 'NoneType' object is not subscriptable

Process finished with exit code 1

这是我的代码。

url = 'http://xx.yy.zz.abc:defg/opac/html/checkouts'  
browser = RoboBrowser(history=False ,parser='lxml')  
browser.open(url=url)  

sign_up = browser.get_form(action='./memberlogin')
sign_up['txtmemberid'].value = 'user-id'
opens = browser.submit_form(sign_up)
print(opens.parsed)

和表格源代码。

<form name="form" method="POST" action="./memberlogin" 
onsubmit="this.onsubmit= function(){return false;}">


<table class="loginTbl" border="1" align="center" cellspacing="3" 
cellpadding="3" width="60%">
   <input type="hidden" name="hdnrequesttype" value="1">
   <thead>
   <tr>
    <td colspan="3" align="middle" class="loginHead">Login</td>
   </tr>
   </thead>

   <tbody class="loginBody">
   <tr>
    <td class="loginBodyTd1" nowrap="nowrap">Employee ID</td>
    <td class="loginBodyTd2"><input type="text" name="txtmemberid" 
id="txtmemberid" value="" class="loginTextBox" size="30" tabindex="1" 
maxlength="8"></td>
    <td class="loginBodyTd3" rowspan="2"><input type="submit" 
class="goclearbutton" value="  Go  " tabindex="3" 
onblur="javascript:setFocus()"></td>

有什么帮助吗?

4

0 回答 0