爬虫-python
sssammmm
像谜 像戏
展开
-
mac下将python2.x升级到python3.x
方法一:官网下载python3.x1、去官网下载python3.x安装包,根据指示安装完成2、删除以前的python2.x安装包3、更改python环境变量打开终端 输入:vi ~/.bash_profile 设置PATH:(以python3.8为例)# Setting PATH for Python 3.8# The original version is saved...原创 2020-05-06 16:15:08 · 526 阅读 · 0 评论 -
webdriver调用phantomJS报错
运行Python文件时报错情况如下: raise WebDriverException(“Can not connect to the Service %s” % self.path) selenium.common.exceptions.WebDriverException: Message: Can not connect to the Service phantomjs先查看环境变量原创 2017-11-29 21:15:22 · 6175 阅读 · 0 评论 -
关于python+Selenium定位元素出错的问题
总结几个我遇到的定位不到元素的情况 一、属性+层次定位 这种情况如果直接写:driver.find_element_by_id(“logout”).click() 是找不到这个元素的,应该采用以下方式定位:driver.find_element_by_xpath(“//*[@id=’logout’]/a”).click()二、跳转到frame中 这种情况就需要用这句程序来先跳转进fra原创 2017-12-01 18:18:20 · 857 阅读 · 0 评论