Skip to content

Tag: python

scrape data using selenium

The program is running good but they will scrape only one TITLE I want they scrape all the title in the page These is the page link https://www.eurobike.com/en/index-exhibitors/exhibitors/? Answer The website is populated completely by complex JavaScript.First of all, to display listing from this url,acceptin…

Functions executing out of order?

I have a problem currently that makes no sense to me whatsoever. I am making a program that runs a script on a website using the selenium web driver. This is paired with a GUI I made with Tkinter. In short, I have a “Launch” button in the gui that is set to trigger this function: “script&#82…

Print text from right side

May I know how to print text to the right side like: I only know center code is this: Thanks Edit str.rjust(165//2) is center text from: How to place input function in center of page? Answer You are doing well just try to use an int like this The first value is the amount of space de second is the

How to exact price from txt file based on the product input?

I’m fairly new to python and can’t solve this issue (I have already searched extensively) My aim is to complete a shopping program where the user inputs the product which the program then reads the associated txt file and returns the items price. This is my current code: The current output i get i…

How do I extract all keys from this JSON file?

The data I’m working with is the entire list of yugioh cards, found at this endpoint: https://db.ygoprodeck.com/api/v7/cardinfo.php There’s a top-level data node that I can ignore, but each sub-node immediately after that (0, 1, 2,…) is a unique card in the cardset. I want to find out how ma…

what would be the most efficient way to do this in pandas

I’m trying to figure out the most efficient way to join two dataframes such as below. I’ve tried pd.merge and maybe using the rank function but cannot seem to figure a way. Thanks in advance df1 What I’m trying to achieve is this df2 Answer You might want to use groupby with unstack as advis…

Find whether 1D sub-array is in 2D array

I have a data-array like: It has about 4000 pairs in it, but typically fewer on the order of a few hundred. I need to find whether a two-valued array already exists in this large data-array, eg. does [1,1] exist in the array? So the function I need should act something like this: I couldn’t get the nump…