Python Help -- Requesting to extract data | Coursera Community

Python Help -- Requesting to extract data

  • 5 March 2021
  • 4 replies
  • 43 views

Badge +1

What am I? doing wrong here?

 

Thank you in advance! 

 


4 replies

Badge

The BS4 directory is not in a sub-directory where your python source code is. I had this error as well - Here is a screenshot of where the bs4 directory must be. I’m running the spider.py file using the command: python3 spider.py 

 

 

Badge +1

So instead of “from bs4” i need to put “from spdump.py”?

The BS4 directory is not in a sub-directory where your python source code is. I had this error as well - Here is a screenshot of where the bs4 directory must be. I’m running the spider.py file using the command: python3 spider.py 

 

 

 

Badge

So instead of “from bs4” i need to put “from spdump.py”?

N​​​​​​​​​​o your code is correct - the bs4 folder is not in the correct place. It needs to be in the same folder as the source code. For instance, my source code (spider.py) sits in Documents/Studies/py4e/pagerank/

And the bs4 folder sits in Documents/Studies/py4e/pagerank/bs4

 

Hope this helps 

 

Badge +1

So instead of “from bs4” i need to put “from spdump.py”?

N​​​​​​​​​​o your code is correct - the bs4 folder is not in the correct place. It needs to be in the same folder as the source code. For instance, my source code (spider.py) sits in Documents/Studies/py4e/pagerank/

And the bs4 folder sits in Documents/Studies/py4e/pagerank/bs4

 

Hope this helps 

Got it thank you! 

 

Reply