url

UnicodeDecodeError for a Python script to extract URLs from a batch of JSON files

UnicodeDecodeError for a Python script to extract URLs from a batch of JSON files Question: I’m trying to make a script for extracting URLs from a batch of JSON files but I’m getting this error I can’t figure out how to resolve: UnicodeDecodeError: ‘charmap’ codec can’t decode byte 0x98 in position 7837: character maps to …

Total answers: 1

How to launch game with urls with python?

How to launch game with urls with python? Question: Using and opening Epic Games Launcher games, I have noticed that they run by using a strange url from the desktop icon. I was wondering, how can I get python to get this to launch the game? (I have already tried running the game’s exe in …

Total answers: 1

Opening links in txt file in headless browser in python

Opening links in txt file in headless browser in python Question: I have been having a problem running the code below and suspect the problem is with link.strip(). The program is running in a linux environment and it is supposed to open multiple links contained in a text files and opens them for snort to …

Total answers: 1

Reading Data from URL into a Pandas Dataframe

Reading Data from URL into a Pandas Dataframe Question: I have a URL that I am having difficulty reading. It is uncommon in the sense that it is data that I have self-generated or in other words have created using my own inputs. I have tried with other queries to use something like this and …

Total answers: 2

Regex for URL without path

Regex for URL without path Question: I know there are many solutions, articles and libraries for this case, but couldn’t find one to match my case. I’m trying to write a regex to extract a URL(which represent the website) from a text (a signature of a person in an email), and has multiple cases: Could …

Total answers: 1

Cyrillic Encoding in Urllib Python with lower cases

Cyrillic Encoding in Urllib Python with lower cases Question: My goal is to encode this dict with cyrilic text: target_dict = {"Animal": "Cat", "city": "Москва"} To this (cyrilic lettesrs with lower case encoded): Animal=Cat&city=%d0%9c%d0%be%d1%81%d0%ba%d0%b2%d0%b0 By default with python it encodes with UPPER CASE, this is my code: import urllib.parse target_dict = {"Animal": "Cat", "city": "Москва"} …

Total answers: 1

Problem Following Web Scraping Tutorial Using Python

Problem Following Web Scraping Tutorial Using Python Question: I am following this web scrapping tutorial and I am getting an error. My code is as follows: import requests URL = "http://books.toscrape.com/" # Replace this with the website’s URL getURL = requests.get(URL, headers={"User-Agent":"Mozilla/5.0"}) print(getURL.status_code) from bs4 import BeautifulSoup soup = BeautifulSoup(getURL.text, ‘html.parser’) images = soup.find_all(‘img’) print(images) …

Total answers: 1

Python Telegram Bot – Calling variable in URL?

Python Telegram Bot – Calling variable in URL? Question: am having difficulty calling a variable as part of the url in a message I intend to send via the Python Telegram bot. Due to the nature of my code, the ‘webpage’ variable varies and the url has to be called as a variable. Placing the …

Total answers: 1

How to turn inputted words into a list of URLs in Python?

How to turn inputted words into a list of URLs in Python? Question: I am a newbie. I am trying to generate a list of links from words inputted in Python. But it always produces only the last link although I input more than one. I have tried to look for the answers but just …

Total answers: 1

passing django variables as parameters into href url

passing django variables as parameters into href url Question: On my home page i want to have 3 links that will redirect the user to a page (‘127.0.0.1:8000/person/<str:name>’) which will display the name that they clicked. I would like to use a for loop to create links for these names as i plan to have …

Total answers: 1