这是我的代码:
import requests as req
from mechanize import Browser , FormNotFoundError
user_inp = raw_input("website : ")
# work with this url :https://faradars.org/
# doesn't work : https://faranesh.com
browser = Browser()
browser.set_handle_robots (False)
browser.open(user_inp)
x = True
count = 0
while x == True :
try :
browser.select_form(nr = count)
browser.form.set_all_readonly(False)
browser.form.set_value("example@yahoo.com", nr=count)
response = browser.submit()
content = response.read()
count += 1
except FormNotFoundError:
x = False
我想制作一个程序,可以打开一个URL并用电子邮件填写新闻通讯表单。它通常可以正常工作而不会出现错误,但是在某些网站上却出现此错误: “ httperror_seek_wrapper:HTTP错误403:禁止”
我该怎么办?