我想從路由器獲取頁面192.168.1.1 /basic/home_dhcplist.htm
,但它在開始時要求輸入用戶名和密碼。如何從Python訪問受密碼保護的路由器頁面?
我通過urllib2的
import urllib2
response = urllib2.urlopen('http://192.168.1.1/basic/home_dhcplist.htm')
html = response.read()
str="Prasads"
value= html.find(str)
print value
if value!=-1 :
print "found"
else:
print "not found"
response.close()
路由器的細節將不勝感激 –