html

Scraping using BeautifulSoup print an empty output

Scraping using BeautifulSoup print an empty output Question: I’m trying to scrape a website. I want to print all the elements with the following class name, class=product-size-info__main-label The code is the following: from bs4 import BeautifulSoup with open("MadeInItaly.html", "r") as f: doc= BeautifulSoup (f, "html.parser") tags = doc.find_all(class_="product-size-info__main-label") print(tags) Result: [XS, XS, S, M, L, …

Total answers: 2

How can i send form by type into input using htmx?

How can i send form by type into input using htmx? Question: I have a search input and sort select. I wrapped it into form. How can i send form by typing into search input (hx-trigger="keyup changed delay:150ms") or selecting another item in select (hx-trigger="changed"). I need to send data from both of this elements. …

Total answers: 1

How to show image from body of post request in flask api?

How to show image from body of post request in flask api? Question: I am trying to display the image captured from the browser/html canvas. A user would basically draw something, and I want to send it to my flask api so i can further process it with opencv, but i am having trouble just …

Total answers: 1

Webscraping with div ng scope class

Webscraping with div ng scope class Question: I am new to web scraping. I am trying to scrape the Event History Table on this site (for example) https://portal.assessor.lacounty.gov/parceldetail/2004001003 However, the class of this "table" is ng-scope and none of the tutorial I googled mentioned how to tackle this class. Can someone provide me some guidance …

Total answers: 1

Selenium Python Finding and selecting a value from a dropdown box

Selenium Python Finding and selecting a value from a dropdown box Question: <div _ngcontent-shg-c319=”” class=”p-field p-grid p-col-12 p-lg-5″><label _ngcontent-shg-c319=”” for=”possession” class=”p-col-12 p-mb-2 p-md-4 p-mb-md-0 asterisk-mark”>Possession</label><div _ngcontent-shg-c319=”” class=”p-col-12 p-md-8″><p-dropdown _ngcontent-shg-c319=”” id=”possession” name=”possession” placeholder=”Select Possession…” class=”ng-tns-c71-41 p-inputwrapper-filled ng-valid ng-touched ng-dirty”><div class=”ng-tns-c71-41 p-dropdown p-component p-dropdown-open”><div class=”p-hidden-accessible ng-tns-c71-41″><input type=”text” readonly=”” aria-haspopup=”listbox” role=”listbox” class=”ng-tns-c71-41″ aria-label=”P2023/3727403″ aria-expanded=”true”></div><span class=”ng-tns-c71-41 p-dropdown-label …

Total answers: 1

Scraping h5 header text in between div tags

Scraping h5 header text in between div tags Question: I am trying to attempt webscraping product prices from this website. How would I go around getting a text value inside a h4 heading in between div classes? HTML: <div class="product-item"> <a href="/product-catalogue?pid=6963"> <div class="list-item-image"> <img src="https://app.digitalconcept.mn/upload/media/product/0001/05/thumb_4760_product_thumb.png" alt="Кофе Bestcup rich creamy 3NI1 1ш"> </div> <h5>Кофе Bestcup …

Total answers: 1

My HTML is not sending the POST method to the flask app function

My HTML is not sending the POST method to the flask app function Question: What’s happening: I have an HTML code that is sending a POST request to the flask code. It’s for a Login page. (I’m using SQLite3 and Flask.) The HTML code: <div class="col"> <div class="login-box"> <h2>Register</h2> <form method="post" action="{{ url_for(‘register_post’) }}"> <div …

Total answers: 1

Remove all text from a html node using regex

Remove all text from a html node using regex Question: Is it possible to remove all text from HTML nodes with a regex? This very simple case seems to work just fine: import htmlmin html = """ <li class="menu-item"> <p class="menu-item__heading">Totopos</p> <p>Chips and molcajete salsa</p> <p class="menu-item__details menu-item__details–price"> <strong> <span class="menu-item__currency"> $ </span> 4 </strong> …

Total answers: 2

How can I solve a "500 Internal Server Error" when importing modules in __init__.py?

How can I solve a "500 Internal Server Error" when importing modules in __init__.py? Question: I use Flask for the first time. The following __init__.py is working fine : Python v3.10.6 #!/usr/bin/env python3 from flask import Flask, render_template, request app = Flask(__name__) @app.route(‘/testurl’) def testurl(): return render_template(‘index.html’) @app.route(‘/from_client’, methods=[‘POST’]) def from_client(): request_data = request.get_json() return …

Total answers: 2

Bootstrap’s cards. How to shorten the words in card with … . Django & CSS

Bootstrap’s cards. How to shorten the words in card with … . Django & CSS Question: I am using the Bootstrap’s card to display my journals. It looks like this: Journal List However, when I insert a lot of word, the card size will be veryyyy long. Journal List With really long essay How to …

Total answers: 2