#-*- coding: UTF-8 -*-#!/usr/bin/env python print("test - 1") import sys from selenium import webdriver print("test - 2") url = "http://XXX.com/" driver = webdriver.Firefox()driver.get(url+ "/") driver.find_element_by_xpath("//div[2]/input").send_keys("XXX") driver.find_element_by_xpath("//div[3]/input").send_keys("XXX") driver.find_element_by_id("loginButton").click() driver.find_element_by_css_selector("a > img").click()driver.quit()
代码如上图
crontab 配置:
export DISPLAY=:0.0 &&python /Users/l/Downloads/phantomjs-2.1.1-macosx/bin/release-day/test.py>> /Users/l/Downloads/log
输出结果优艾设计网_平面设计为:
test - 1
请教是什么问题?解决方案是什么?
精彩评论