Skip to content

Chapter 2. ioBottleneck2.py doesnt work - i fixed it. #8

Description

@zoldaten

for python3 use:
import urllib.request
import time
from bs4 import BeautifulSoup

linkArray = []
def getLinks():
req = urllib.request.urlopen('http://www.example.com')
soup = BeautifulSoup(req.read(),features="lxml")
for link in soup.findAll('a'):
linkArray.append(link.get('href'))
print(len(linkArray))

getLinks()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions