html

How to prevent django fields from being wrapped in a `div`?

How to prevent django fields from being wrapped in a `div`? Question: If I use the below to generate multiple radio buttons: from django import forms class MCQCollectionForm(forms.Form): user_input = forms.ChoiceField( widget=forms.RadioSelect, label=”, choices=enumerate([‘option 1’, ‘option 2’]) ) I get: <div id="id_user_input"> <div> <label for="id_user_input_0"><input id="id_user_input_0" name="user_input" required="" type="radio" value="0"> option 1</label> </div> <div> <label …

Total answers: 1

Multiple H3 tags – but only need a specific one with web scraping

Multiple H3 tags – but only need a specific one with web scraping Question: How do I target a text within specific H3 tags if there are multiple H3 tags? I’m currently trying the below code but it only returns the first H3 tag with the string "1" instead of the second one with the …

Total answers: 1

The utf-8 encoding does not work correctly

The utf-8 encoding does not work correctly Question: I am making a programme to visualise reports in HTML. It’s nothing complicated, I read the CSV file added some style(for text and table) some text and read the DF as a table. This is how code looks like: df = pd.read_csv("Średnie wyniki oceny użytkowości rozpłodowej loch …

Total answers: 1

Get ALL strings from html

Get ALL strings from html Question: I send get requests to different sites. In response I get HTML pages. How can I get only strings from the HTML page? I mean all strings in general (the ones colored white in my screenshot). I understand how I can get "div", "code", "a", and etc tags. But …

Total answers: 1

Scraping content from what appear to be identical HTML elements

Scraping content from what appear to be identical HTML elements Question: Python: Python 3.11.2 Python Editor: PyCharm 2022.3.3 (Community Edition) – Build PC-223.8836.43 OS: Windows 11 Pro, 22H2, 22621.1413 Browser: Chrome 111.0.5563.65 (Official Build) (64-bit) I’m looking at the following URL — https://dockets.justia.com/docket/puerto-rico/prdce/3:2023cv01127/175963 — from which I’m attempting to scrape data from class elements that …

Total answers: 1

Adding items to wishlist

Adding items to wishlist Question: so Im trying to work on adding a wishlist item to the wishlist page. So Im creating a view to add a wishlist to the page and a view to show the items ive added. But the issues ocurs when i press the add to wishlist button on a product.The …

Total answers: 1

Flask form not validating on submit

Flask form not validating on submit Question: I’m trying to make a form that looks like an exam page. I have a checkbox and a submit button, the submit button when clicked does not do anything. The HTML code in exam.html {% extends ‘layout.html’ %} {% block content %} <h3 class="pt-5 p-4">exam page</h3> <div class="form"> …

Total answers: 1

Getting a book genres and language scraped from goodreads using beautifulsoup

Getting a book genres and language scraped from goodreads using beautifulsoup Question: I was trying to scape a book metadat from goodreads but, i can’t get it right for geners and language here are the code import re from bs4 import BeautifulSoup from argparse import Namespace from urllib.request import urlopen import pandas as pd def …

Total answers: 1

Multiple span tag under one parent DIV id always returns first record

Multiple span tag under one parent DIV id always returns first record Question: I have multiple span tag with same class name under one parent div id. But, the BeautifulSoup item loop always returns first attribute only, rest of the attributes are not printing. Note : All of my span class names are same as …

Total answers: 1

Loading data from a dynamically generated html url

Loading data from a dynamically generated html url Question: I wanted to know is Selenium the only library that would be able to access data from a table in a webpage specifically here. When I try to parse these sites using bs4 it doesn’t have any data in the tables just the headers, it works …

Total answers: 1