skip to Main Content

Remove all text from a html node using regex

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…

VIEW QUESTION

BeautifulSoup Cannot Find Tag img – Html

Im trying to scrape the link of image from url https://www.eaton.com/us/en-us/skuPage.101012%2520G.html All my solutions failed; here are my attempts: print(soup.select_one('[class="module-media-gallery__image lazyload"]')["src"]) img=soup.find('img',attrs={'class':'module-media-gallery__image lazyload'}) img=soup.find('img',class_='module-media-gallery__image lazyload')

VIEW QUESTION

Cannot locate text within using Python – Html

Hi all, I am scraping questions on Amazon using the following code: url = "https://www.amazon.com/ask/questions/asin/B0000CFLYJ/1/ref=ask_ql_psf_ql_hza?isAnswered=true" r = requests.get("http://localhost:8050/render.html", params = {'url': url, 'wait': 3}) soup = BeautifulSoup(r.text, 'html.parser') questions = soup.find_all('div', {'class':'a-fixed-left-grid-col a-col-right'}) print(questions) question_list = [] for item in…

VIEW QUESTION

how to scrape – span aria-hidden="true" – text – Html

<div class="comments-post-meta__profile-info-wrapper display-flex"> <a class="app-aware-link inline-flex overflow-hidden t-16 t-black t-bold tap-target" target="_self" href="https://www.linkedin.com/in/ACoAAAAg-vkBuoZD8xeJW57GlPMiPRWUe-jvvSM" data-test-app-aware-link=""> <h3 class="comments-post-meta__actor display-flex flex-column overflow-hidden t-12 t-normal t-black--light"> <span class="comments-post-meta__name text-body-small-open t-black"> <span class="comments-post-meta__name-text hoverable-link-text mr1"> <span dir="ltr"><span aria-hidden="true"><!---->Nathan Greenhut<!----></span> <span class="visually-hidden"><!---->View Nathan Greenhut’s profile<!----></span> </span>…

VIEW QUESTION
Back To Top
Search