我正在运行Python 3.5.1 for Mac.我想用urllib2.我尝试安装它,但我被告知它已被拆分为urllib.request和urllib.error for Python 3.
我的命令(暂时从框架bin目录运行,因为它不在我的路径中):
sudo ./pip3 install urllib.request
Run Code Online (Sandbox Code Playgroud)
返回:
Could not find a version that satisfies the requirement urllib.request (from versions: )
No matching distribution found for urllib.request
Run Code Online (Sandbox Code Playgroud)
我在尝试一举安装urllib2之前遇到了同样的错误.
我正在寻找作为网络开发人员的全职工作.从好的方面来说,我有15年的经验.在缺点方面,我的技能有点陈旧,因为我花了大约五年左右的时间花在营销工作上,我正在做的小网页编码主要是维护内容.结果,我的技能变得有些陈旧.
我正在学习AngularJS(AngularJS Up and Running)的书,我正在研究它.但是,由于我没有在实际应用程序中使用它的任何经验,我想通过某种凭证将其放到我的简历中.
是否有任何值得获得的认证?Google推出了一些像Udemy这样的MOOC,一旦你完成他们的课程,显然会给你一个"完成证明",但我不知道它有多少价值.
我必须在这里找到一些不匹配的版本,因为我无法使用Python启动Selenium来启动Firefox Web浏览器.我使用的是旧版本的Firefox,因为这里的其他人拥有相同的旧版本的Python,对于他们来说,旧版本的Firefox效果最好.
码:
from selenium import webdriver
from selenium import common
from selenium.webdriver import ActionChains
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.common.exceptions import TimeoutException
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
driver=webdriver.Firefox(capabilities=DesiredCapabilities.FIREFOX)
Run Code Online (Sandbox Code Playgroud)
错误:
Traceback (most recent call last):
File "scrapeCommunitySelenium.py", line 13, in <module>
driver=webdriver.Firefox(capabilities=DesiredCapabilities.FIREFOX)
File "/Library/Python/2.7/site-packages/selenium/webdriver/firefox/webdriver.py", line 158, in __init__
keep_alive=True)
File "/Library/Python/2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 154, in __init__
self.start_session(desired_capabilities, browser_profile)
File "/Library/Python/2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 243, in start_session
response = self.execute(Command.NEW_SESSION, parameters) …Run Code Online (Sandbox Code Playgroud) 做一些本地网站工作来学习 Wordpress 主题开发。
尝试通过提示设置Wordpress,也尝试通过在wp-config.php文件中手动输入信息,都不起作用。还是无法连接数据库,setup-config.php页面返回“Error建立数据库连接”。我已经对登录凭据(数据库名称、用户名、密码等)进行了两次、三次和四次检查,它们是完整且正确的。删除 wp-config.php 并通过网页再次尝试,结果相同。
MySQL 肯定正在运行,Mac 系统首选项面板是这样说的,我可以在命令行登录并运行 SQL 查询,尽管我必须以 root 身份执行此操作。我应该以 root 身份运行 MySQL 吗?
这个问题存在于 Wordpress 以及我也安装的 phpMyAdmin 实例中,所以我认为这与 PHP 代码没有任何关系,它更像是一个权限问题。对于它的价值,我已经编辑了我的 httpd.conf 文件以在端口 80 上获取 Wordpress,在 8081 上获取 phpMyAdmin。Apache 正在为这些站点提供应有的服务,并且 PHP 正在运行,它只是让任一站点连接到数据库问题。
系统信息:
Mac OS X 10.9.5(小牛队)
PHP 版本 5.4.30
MySQL 版本:mysql Ver 14.12 Distrib 5.0.45,用于 apple-darwin9.2.0 (i686) 使用 EditLine 包装器
我发誓我已经在页眉中包含了 jquery,它就在那里!
尽管如此,我已经包含在页面底部附近(现在是内联的)的以下代码给了我一个错误,指出“TypeError:$ 不是函数”。
<script>
function displayResult(longA, latA, longB, latB, units) {
$("#distance").html(calcDist(longA, latA, longB, latB, units));
if (units=="m") {
$("#unitLabel").html("miles");
$("units").prop("selectedIndex",0);
} else {
$("#unitLabel").html("kilometers");
$("#units").prop("selectedIndex",1);
}
$("#longA").val(longA);
$("#latA").val(latA);
$("#longB").val(longB);
$("#latB").val(latB);
}
$("#calculateButton").click(function() { //This is the line it's complaining about
var longA=$("#longA").val();
var latA=$("#latA").val();
var longB=$("#longB").val();
var latB=$("#latB").val();
var units=$("#units").val();
displayResult(longA, latA, longB, latB, units);
})(jQuery);
</script>
Run Code Online (Sandbox Code Playgroud)
在页眉的更高处,我有以下内容:
<script src="jquery.js" ></script>
<script src="calcDistSinglePage.js" ></script>
Run Code Online (Sandbox Code Playgroud)
我没有使用 Wordpress 或任何东西,这是一个非常简单的手工编码 HTML 页面。
python ×2
angularjs ×1
apache ×1
firefox ×1
geckodriver ×1
javascript ×1
jquery ×1
macos ×1
mysql ×1
phpmyadmin ×1
python-3.x ×1
selenium ×1
urllib2 ×1
wordpress ×1