本文整理汇总了Python中mechanize.Browser.form['input']方法的典型用法代码示例。如果您正苦于以下问题:Python Browser.form['input']方法的具体用法?Python Browser.form['input']怎么用?Python Browser.form['input']使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mechanize.Browser
的用法示例。
在下文中一共展示了Browser.form['input']方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: len
# 需要导入模块: from mechanize import Browser [as 别名]
# 或者: from mechanize.Browser import form['input'] [as 别名]
finalTxt=""
for td in td_list:
text = td.getText()
text = re.sub("( )*","",text)
text = re.sub("(<)*","",text)
text = re.sub("(>)*","",text)
finalTxt=finalTxt+"\t"+text
#print finalTxt
resultList.append(finalTxt)
return resultList
br.select_form(nr=0)
br.form['input']="சொத்து குவிப்பு : விசாரணைக்கு டெல்லி செல்ல மறுத்த மதுகோடா!"
br.submit()
resultList = parseResponse(br.response().read())
resultList=resultList[0:-3]
# print relevant stuff
for each in resultList:
each = each.strip()
comp = each.split()
#print comp
tokenId = comp[0]
token_comp = tokenId.split(".")
if len(token_comp)>1:
print each
示例2: open
# 需要导入模块: from mechanize import Browser [as 别名]
# 或者: from mechanize.Browser import form['input'] [as 别名]
text = re.sub("(>)*","",text)
finalTxt=finalTxt+"\t"+text
#print finalTxt
resultList.append(finalTxt)
return resultList
# Batch version! Read from the file
ipFile = open(sys.argv[1],"rb")
opFile = open(sys.argv[2],"wb")
for eachLine in ipFile:
br.open("http://ltrc.iiit.ac.in/analyzer/tamil/")
br.select_form(nr=0)
br.form['input']=eachLine
br.submit()
resultList = parseResponse(br.response().read())
resultList=resultList[0:-3]
print eachLine
# print relevant stuff
opFile.write("0 temp\n")
for each in resultList:
each=each.strip()
if not each:
continue
each = each.strip()
comp = each.split()
#print comp
tokenId = comp[0]