404 error when polling Reddit's developer API

I am trying to use Reddit’s developer API to build a simple scraper that grabs posts and their replies in a target subreddit and produces JSON with the information. I am getting a 404 error that I don’t understand. This is my code: import praw import json def scrape(subreddit, limit): r = praw.Reddit(user_agent=’Reddit data organizer… Read More 404 error when polling Reddit's developer API

why can't it not find this cookie?

I want to scrape this website: https://dbh.smartschool.be/ for a school project but I always run into a problem whit the authentication and I have no cleu why. this is my code: import requests URL = "https://dbh.smartschool.be" LOGIN_ROUTE = "/login" HEADERS = { "User-Agent" : "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0… Read More why can't it not find this cookie?

Can someone explain what the beautifulsoup package does

I have been trying to read a find out what the beautifulsoup package is in python, but I cannot seem to understand it >Solution : try this import requests from bs4 import BeautifulSoup as bs import io from PyPDF2 import PdfFileReader URL = ‘https://www.comafi.com.ar/custodiaglobal/eventos-corporativos.aspx’ FILETYPE = ‘.pdf’ FILENAME = ‘Anuncio de dividendo’ def get_soup(url): return… Read More Can someone explain what the beautifulsoup package does

Scraping a webpage with Python but unsure how to deal with a static(?) URL

I am trying to learn how to pull data from this url: https://denver.coloradotaxsale.com/index.cfm?folder=auctionResults&mode=preview However, the problem is that the URL doesn’t change when I am trying to switch pages so I am not exactly sure how to enumerate or loop through it. Trying to find a better way since the webpage has 3 thousand datapoints… Read More Scraping a webpage with Python but unsure how to deal with a static(?) URL

Unable to download a file using Selenium Python

I am trying to download a file using the Selenium library from the source page = "https://ec.europa.eu/info/law/better-regulation/have-your-say/initiatives/12527-Artificial-intelligence-ethical-and-legal-requirements/F2665623_en" you can see the file at the bottom of website Following is the code I try to run from selenium.webdriver.common.by import By from selenium import webdriver from selenium.webdriver.chrome.options import Options driver.get(‘https://ec.europa.eu/info/law/better-regulation/have-your-say/initiatives/12527-Artificial-intelligence-ethical-and-legal-requirements/F2665640_en’) downloadfile = driver.find_element(By.CLASS_NAME, ‘ecl-file__download’) time.sleep(4) downloadfile.click(); but… Read More Unable to download a file using Selenium Python

xpath wrong using selenium

I am trying to get Fax number but they gave me nothing these is page link https://www.barreaunantes.fr/annuaire-des-avocats/stephanie-dreux/ from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.support.wait import WebDriverWait from selenium.webdriver.support.select import Select PATH="C:\Program Files (x86)\chromedriver.exe" url=’https://www.barreaunantes.fr/annuaire-des-avocats/stephanie-dreux/’ driver =webdriver.Chrome(PATH) wait = WebDriverWait(driver, 20) driver.get(url) Fax = driver.find_element(By.XPATH, "//p//strong[contains(text(),’Fax : ‘)]").text print(Fax) >Solution : You’re trying… Read More xpath wrong using selenium