Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 16418

Python TypeError Traceback (most recent call last)

$
0
0

I am trying the build a crawler, and I want to print all the links on that pageI am using Python 3.5

there is my code

import requestsfrom bs4 import BeautifulSoupdef crawler(link):    source_code = requests.get(link)    source_code_string = str(source_code)    source_code_soup = BeautifulSoup(source_code_string,'lxml')    for item in source_code_soup.findAll("a"):        title = item.string        print(title)crawler("https://www.youtube.com/watch?v=pLHejmLB16o")

but I get the error like this

TypeError                                 Traceback (most recent call last)<ipython-input-13-9aa10c5a03ef> in <module>()----> 1 crawler('http://archive.is/DPG9M')TypeError: 'module' object is not callable

Viewing all articles
Browse latest Browse all 16418

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>