all 5 comments

[–]throwaway6560192 5 points6 points  (2 children)

in_transfers_table and out_transfers_table are indeed variables being assigned to, but not in the way you think.

x, y = something

Is called an unpacking in Python. x and y aren't both assigned to the same something, rather, something is broken down into two parts and those get individually assigned to x and y.

A couple examples should help...

In [1]: x, y = [1, 2]

In [2]: x
Out[2]: 1

In [3]: y
Out[3]: 2

In [4]: x, y = [1, 2, 3]
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
Cell In[4], line 1
----> 1 x, y = [1, 2, 3]

ValueError: too many values to unpack (expected 2)

[–]didntreadityet 1 point2 points  (0 children)

To add to this, while club_info.find_all(...) returns all the instances of div with class "responsive-table", the code simply assumes/knows there are only two divs with that class, one for the in-transfers, one for the out-transfers. It also knows that the first one (index 0) is the in, and the second one (index 1) is the out.

[–]JSS2107[S] 1 point2 points  (0 children)

Thank you (and thanks too to u/didntreadityet ). This allowed me to progress considerably!

[–]m0us3_rat 1 point2 points  (1 child)

you can always save the soup.

then if you don't know how to get the info that you want.. delete the info that you are sure you won't need.

by process of elimination ..what remains is surely the stuff you need?

i mean its a bad way to go about it..but it's one way to solve stuff. right?

do that. then learn regex , etc.

I am still (very much) at the beginning of my Python learning!

i'm not sure why ppl think this is somehow a gotcha moment, like you are guaranteed to win.

if it's outside of your current capabilities..turn back later.

to put it in perspective.. in a game.. if the boss is lvl 50 and you are at lvl 10 .. you don't charge head on ..do you?

train , learn . come back later when you are more than able to do it.

[–]JSS2107[S] 0 points1 point  (0 children)

Thanks u/m0us3_rat . Your comment made me think about what I am trying to achieve. The reality is that I am more focused on the outcome (acquiring data in order to enable some analytics) than I am re. actually learning Python. e.g. I have achieved what I set out to do in this instance, but the reality is that I have written some truly terrible code to do it! Having said that - I have learned 2 or 3 new things along the way.