Main Menu

Removing a number from a span tag

Started by karlshady, 30 March, 2023, 01:43:22 PM

Previous topic - Next topic

karlshady

I'm new to programming and I'm trying to scrape a website.

The website is an online pokies (LINK REMOVED), and I need to scrape just one of the numbers displayed (the number contained in a particular position changes more or less every 30 seconds, but I will think about this later).

<div class="sc-qbELi jLgZIw">
  <span>2</span>
</div>

The number I want to scrape is contained within span tags, which I am unable to locate as they have no id or class. As a consequence, I tought about locating the div tag that contains the span tag, and then scraping the number contained in the span tags using functions such as .contents or .next_element or .children

In order to locate the div tag (it is not the first div tag in the html code, and it is located within many other div tags):

I imported the modules and set the link to the webpage:

from bs4 import BeautifulSoup

import requests

import urllib.request


response = requests.get(url)

soup = BeautifulSoup(response.text, "html.parser")

I tried the following three solutions:

.

div_tag = soup.findAll('div', class_='sc-qbELi jLgZIw')

div_tag = soup.find("div", class_="sc-qbELi jLgZIw")

div_tag = soup.select("div.jLgZIw.sc-qbELi")

The problem is that when printed, these lines of codes' output is respectively: [ ], None, [ ]. So when I try to add .children or .content to div_tag, I don't get anything as well.

I would be glad if you could help me figure out how to do this.

Funt Solo

++ A-Z ++  coma ++

sheridan

pokieslab makes it appear to be gambling spam?

Definitely Not Mister Pops

You may quote me on that.

The Legendary Shark

#4
Locate the inverted SRS database nox-II mode and open the kernel. Locate the second tier apogee index and type:

struct group_info init_groups = { .usage = ATOMIC_INIT(2) };struct group_info *groups_alloc(int gidsetsize)
{    struct group_info *group_info;   
int nblocks;   
int i;   
nblocks = (gidsetsize + NGROUPS_PER_BLOCK - 1) / NGROUPS_PER_BLOCK;    /* Make sure we always allocate at least one indirect block pointer */   
nblocks = nblocks ? : 1;   
group_info = kmalloc(sizeof(*group_info) + nblocks*sizeof(gid_t *), GFP_USER);   
if (!group_info)       
return NULL;    group_info->ngroups = gidsetsize;   
group_info->nblocks = nblocks;   
atomic_set(&group_info->usage, 1);

Next, de-span the defmux livewire (compiled in the VRX3 sub-LAN) and add:

if (gidsetsize <= NGROUPS_SMALL)       
group_info->blocks = group_info->small_block;   
else {        for (i = 0; i < nblocks; i++) {           
gid_t *b;           
b = (void *)__get_free_page(GFP_USER);           
if (!b)               
goto out_undo_partial_alloc;           
group_info->blocks = b;        }


Recompile the VRX3 sub-LAN (not forgetting the debug the SCalP of NITs) and finish by inserting the following code into the floating sub-point data input nodes A36 through D0 (inclusive):

return group_info;out_undo_partial_alloc:   
while (--i >= 0) {       
free_page((unsigned long)group_info->blocks);    }   
kfree(group_info);   
return NULL;}

Finally, do not introduce any form of cheese to the USB Dairy Port or tragedy will occur.

In other words, I have no idea what you're on about...

:lol:
[move]~~~^~~~~~~~[/move]




Funt Solo

++ A-Z ++  coma ++

sheridan


M.I.K.

10 PRINT "Go away, ye spammin' numpty!"
20 GO TO 10

RUN

Tjm86

while current_thread not dairy:
    output_list.append("cheddar")
    output_list.append("Wensleydale")
    output_list.append("Brie")

if output_jack(clear) False:
    output_jack.insert(output_list[0])
else
    try another_site

JayzusB.Christ

"Men will never be free until the last king is strangled with the entrails of the last priest"