#!/usr/bin/env python
# _*_ coding:utf-8 _*_
#避免蜜罐
from selenium import webdriver
driver=webdriver.phantomjs(executable_path='D:/pycharm/phantomjs-2.1.1-windows/bin/phantomjs')
driver.get("http://pythonscraping.com/pages/itsatrap.html")
links=driver.find_elements_by_tag_name("a")
for link in links:
if not link.is_displayed():
print("the link "+link.get_attribute("href")+" is a trap")
fields=driver.find_elements_by_tag_name("input")
for field in fields:
if not field.is_displayed():
print("do not change value of "+field.get_attribute("name"))