url

Creating URLs in a loop

Creating URLs in a loop Question: I am trying to create a list of URLs using a for loop. It prints all the correct URLs, but is not saving them in a list. Ultimately I want to download multiple files using urlretrieve. for i, j in zip(range(0, 17), range(1, 18)): if i < 8 or …

Total answers: 2

React – Django page is blank on refresh

React – Django page is blank on refresh Question: Hello I am using Django as my backend and React as frontend. I have an issue when I refresh page and I am not on root page ‘/’ the page goes blank. Also If Ill try to go instantly somewhere else then the home page such …

Total answers: 2

Open Whatsapp Windows app directly from python program using url

Open Whatsapp Windows app directly from python program using url Question: According to this FAQ page of Whatsapp on How to link to WhatsApp from a different app Using the URL whatsapp://send?phone=XXXXXXXXXXXXX&text=Hello can be used to open the Whatsapp app on a Windows PC and perform a custom action. It does work when it is …

Total answers: 2

Get YouTube Playlist urls with python

Get YouTube Playlist urls with python Question: How I can get the playlist urls stored like here: https://www.youtube.com/watch?v=VpTRlS7EO6E&list=RDOIhVs0FQ8xc&index=5 with bs4? Using from bs4 import BeautifulSoup as bs import requests r = requests.get(‘https://www.youtube.com/watch?v=OIhVs0FQ8xc&list=RDOIhVs0FQ8xc&index=1′) page = r.text soup=bs(page,’html.parser’) #print(soup) res=soup.find_all(‘ytd-playlist-panel-video-renderer’) print(res) doesn’t return anything. Even printing the soup itself doesn’t contain the link I’am looking for (like …

Total answers: 4

Django ViewSet ModuleNotFoundError: No module named 'project name'

Django ViewSet ModuleNotFoundError: No module named 'project name' Question: I’m trying to use the ModelViewSet to display Users, but for some reason Django does not seem to like the UserViewSet import in project/urls.py. Seems like a pretty silly error, but I’ve been stuck on this for a while and it’s frustrating. I don’t have any …

Total answers: 2

How to check whether a URL is downloadable or not?

How to check whether a URL is downloadable or not? Question: How do I check whether the given url is downloadable or not using Python? It should return True if it is downloadable else False An example of a non-downloadable url: www.google.com Note: I am not speaking about contents of the URL and saving it …

Total answers: 4

How do I properly use a UUID id as a url parameter in Django?

How do I properly use a UUID id as a url parameter in Django? Question: I’ve been trying to pass a UUID4 id into the url for a specific detail page. After browsing Stackoverflow and other sites, here’s what I’ve tried so far: Passing the url path as path(‘car/<uuid:id>/’, views.CarDetailView.as_view(), name=’car-detail’), But this raises the …

Total answers: 3

Download all pdf files from a website using Python

Download all pdf files from a website using Python Question: I have followed several online guides in an attempt to build a script that can identify and download all pdfs from a website to save me from doing it manually. Here is my code so far: from urllib import request from bs4 import BeautifulSoup import …

Total answers: 5

NoReverseMatch after include Favorite button

NoReverseMatch after include Favorite button Question: I’m pretty new at Django framework, and following a tutorial. Although when I tried to include a input button for favorites on my detail.html I got this error: Error during template rendering In template C:Usersleo8DesktopLucasc2view03webdevetemplatesdetail.html, error at line 8 Reverse for ‘favorites’ with arguments ‘(”,)’ not found. 1 pattern(s) …

Total answers: 1