关于python爬虫中beautifulsoup4与正则表达式的运用问题!

import urllib.request
import re
from bs4 import BeautifulSoup

def main():
    url = "http://baike.baidu.com/view/284853.htm"
    response = urllib.request.urlopen(url)
    html = response.read()
    soup = BeautifulSoup(html, "html.parser") # 使用 Python 默认的解析器

    for each in soup.find_all(href=re.compile("view")):
        print(each.text, "->", ''.join(["http://baike.baidu.com", each["href"]]))
        # 上边用 join() 不用 + 直接拼接,是因为 join() 被证明执行效率要高很多

if __name__ == "__main__":
    main()

输出结果:

恐龙百科 -> http://baike.baidu.com/wikicategory/view?categoryName=恐龙大全
多肉百科 -> http://baike.baidu.com/wikicategory/view?categoryName=多肉植物
锁定 -> http://baike.baidu.com/view/10812319.htm

这串代码中

for each in soup.find_all(href=re.compile("view")):

这一句没有看太懂
如果将括号内的 href= 去掉或者将 href 换成其他字符的话的话就无法打印出内容,href=在这里是什么意思啊?
没有 href= 的话不也是一个完整的正则表达式吗

soup.find_all(href=re.compile("view"))
soup.查找所有(href属性里面含有view关键字)的结果
有时间看看RE模块的用法