request

Webscrapping with bs4: Type Error – 'NoneType' object is not subscriptable

Webscrapping with bs4: Type Error – 'NoneType' object is not subscriptable Question: I am trying to extract "video" from the url and print how many there are in the console. But I get this Error: TypeError: ‘NoneType’ object is not subscriptable Here is my code: import requests from bs4 import BeautifulSoup Web_url = "https://watch.plex.tv/show/hannibal/season/1/episode/9" r …

Total answers: 1

Django POST request is empty

Django POST request is empty Question: Running Django 4.1.1. Having this code below in template. By clicking a button it sends a data to delete apropriate marker. <form method="POST"> {% csrf_token %} <ol> {% for marker in markers %} <li> {{ marker }} – <button class="button btn-primary" id="delete" value="{{ marker.pk }}" type="submit">Delete</button> </li> {% endfor …

Total answers: 1

How can I access dict from JSON dict after making an API call?

How can I access dict from JSON dict after making an API call? Question: i want to access the values in the dict but i can not do response["establishments"] because there is a strange b symbol in the dict when it was return . How can I get rid of the b symbol so i …

Total answers: 3

Python pandas normalize this Json into pandas

Python pandas normalize this Json into pandas Question: I’m trying to get this json request into df, my code is like this gateio = requests.get("https://data.gateapi.io/api2/1/tickers") e = gateio.json() gateio = json_normalize(e) print(gateio) I get the data not correctly. stos_eth.highestBid stos_eth.percentChange stos_eth.baseVolume stos_eth.quoteVolume stos_eth.high24hr stos_eth.low24hr rune_eth.result rune_eth.last rune_eth.lowestAsk rune_eth.highestBid rune_eth.percentChange rune_eth.baseVolume rune_eth.quoteVolume rune_eth.high24hr rune_eth.low24hr 0 0.0001413 …

Total answers: 1

Unable to crawl full website HTML content using python selenium or request library

Unable to crawl full website HTML content using python selenium or request library Question: I am trying to crawl this site "https://ec.europa.eu/info/law/better-regulation/have-your-say/initiatives/12527-Artificial-intelligence-ethical-and-legal-requirements/feedback_en?p_id=24212003" but getting only header and few body responses, unable to get full paragraph content and links of pages. from selenium import webdriver from selenium.webdriver.chrome.options import Options options = Options() options.headless = True options.add_argument("–window-size=1920,1200") …

Total answers: 1

Unable to load URL

Unable to load URL Question: import requests url = https://www.nseindia.com/get-quotes/equity?symbol=ACC data = requests.get(‘https://www.nseindia.com/get-quotes/equity?symbol=ACC”) print(data) I’m trying to load data from above url but failed. How to do that? I got a invalid syntax error. Asked By: Brijesh Chaurasia || Source Answers: You mean this? import requests data = requests.get(‘https://www.nseindia.com/get-quotes/equity?symbol=ACC’) print(data) Saying url = https://www.nseindia.com/get-quotes/equity?symbol=ACC is …

Total answers: 3

OSError: [Errno 63] File name too long in JSON FILE (python)

OSError: [Errno 63] File name too long in JSON FILE (python) Question: i have this error – OSError: [Errno 63] File name too long: what is the best way to work around this? import requests import json import codecs url = ‘https://ratings.food.gov.uk/OpenDataFiles/FHRS314en-GB.json’ response = requests.get(url) text = response.text data = json.load(codecs.open(text, encoding=’utf8′)) print(‘data’, data) Asked …

Total answers: 2

Save Images with orginal name

Save Images with orginal name Question: I have script to download images from website. But it’s saves name with ‘images1, images2, images3, images4 etc’ I need to save images with orginal name. If the images name 43343.jpg i need to save with 43343.jpg I use beautifulsoup and requests for this case. Sorry my english. It’s …

Total answers: 1

Python Get Request Loop

Python Get Request Loop Question: hopefully there is a kind soul out there which will offer to graciously answer my question as I continue my learning experience. I have written the following simple python code to bring back a sporting web site I would like to scrape. I want to be able to scrape from …

Total answers: 1

httpx – send multiple requests from dynamic list

httpx – send multiple requests from dynamic list Question: I would like to send multiple request at once to the API. But I do not know how to trigger the requests because part of the URL is loaded from dynamic list which can have different length every time. Right now I am looping through the …

Total answers: 1