Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试让我的 python 脚本检测页面上的警报框
import urllib2 url = raw_input("Please enter your url: ") if urllib2.urlopen(url).read().find("<script>alert('alert');</script>") == 0: print "Alert Detected!"
我怎样才能让它检测到警报?
urllib2.urlopen(url).read().find("<script>alert('alert');</script>") == 0至 urllib2.urlopen(url).read().find("<script>alert('alert');</script>") >= 0
urllib2.urlopen(url).read().find("<script>alert('alert');</script>") == 0
urllib2.urlopen(url).read().find("<script>alert('alert');</script>") >= 0