Quantcast
Channel: Active questions tagged youtube-api - Stack Overflow
Viewing all articles
Browse latest Browse all 3831

Receiving error "name 'urllib' is not defined" when using urllib.parse despite including "import urllib.parse"

$
0
0

I receive the error "name 'urllib' is not defined" when using urllib.parse despite including "import urllib.parse" at the top of my code. The error occurs when using the "search" function in the youtube data api.

My code is as follows

from youtube_api import YouTubeDataAPIimport urllib.parseapi_key = # actual api key inserted hereyt = YouTubeDataAPI(api_key)search = yt.search(location = (2.09319, 96.647463), \                        locationRadius = "50km", \                        order_by = "viewCount", \                        topic_id = "/m/06bvp", \                        max_results = 5)

The output should be similar to as outlined on this page

I receive the following error:error with urllib not being defined

How can this be happening if I've included "import urllib.parse"? I've also tried "import urllib" and have the same issue.


Viewing all articles
Browse latest Browse all 3831

Trending Articles



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