Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/python-3.x/19.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 3.x 解析时出现意外的EOF:web刮取_Python 3.x_Beautifulsoup - Fatal编程技术网

Python 3.x 解析时出现意外的EOF:web刮取

Python 3.x 解析时出现意外的EOF:web刮取,python-3.x,beautifulsoup,Python 3.x,Beautifulsoup,为什么我会犯这个错误 SyntaxError:分析时出现意外的EOF 打印(tag.get('href',none)需要以另一个结尾) 列克: import urllib.request, urllib.parse, urllib.error from bs4 import BeautifulSoup url = input("enter your url here : " ) html = urllib.request.urlopen(url).read() soup =

为什么我会犯这个错误

SyntaxError:分析时出现意外的EOF

打印(tag.get('href',none)
需要以另一个
结尾)
列克:

import urllib.request, urllib.parse, urllib.error
from bs4 import BeautifulSoup
url = input("enter your url here : " )
html = urllib.request.urlopen(url).read()
soup = BeautifulSoup(html,'html.parser')
tags = soup('a')
for tag in tags:
    print(tag.get('href',none)

是的,谢谢你。结果又是我的疏忽了:“你知道吗(
print(tag.get('href',none))