I’ve now tried everything for the past few hours but I can’t extract a specific thing from the HTML below. I want to grab the “sessionCartId” but I can’t figure out how…. Thats what i tried so far : ^^ This gives me the correct script tag but i cant transform it into a json…
Tag: python
exporting DF to csv with variable file names
I would like to keep this same code but adjust the .to_csv section to save a variable repeating file name I would like the names of the exported files to look like this…I think I need some sort of loop? Period 1 layer 1.csv Period 1 layer 2.csv Period 1 layer 3.csv Period 1 layer 4.csv Period 1 layer 5.…
Checking progress of an ongoing for loop in JupyterLab
I have been running a for loop for 4 days now. I understand that there are better ways to do it, but I needed to run it just once. Is there a way to check the progress without interrupting the loop? I’m terrified to loose all of my progress. This is my code Answer Given the information from your comment…
py-wallpaper returning “is not recognized as an internal or external command”
Hi there, I am trying to change my windows 11 background wallpaper using the simplest way, so I just found py-wallpaper library where I can: But even if I use one of them I just get this error: Note: I do not want to use ctypes Answer win.py contains the code used to set and load wallpapers. The file contains
collision issue with pygame in python3 using tiled
im working on a litle game using pygame in python3. Im using tiled for the map and pyscroll for the camera and i don’t know how to solve this issue: i made detection collision that work using object layer in tiled and a litle bit of code. the detection work pretty well but when it come to say to the
Scrapy extracting entire HTML element instead of following link
I’m trying to access or follow every link that appears for commercial contractors from this website: https://lslbc.louisiana.gov/contractor-search/search-type-contractor/ then extract the emails from the sites that each link leads to but when I run this script, scrapy follows the base url with the entir…
TypeError: pretty_print() takes 1 positional argument but 2 were given
PyCharm return “TypeError: pretty_print() takes 1 positional argument but 2 were given” I’ve searched for the whole night but still can’t figure it out Answer In your code (t, 0, t) is the second argument to pprint (which takes only one positional argument), but it’s meant to be …
How can I add items and avoid duplicates to my inventory in a text based adventure game?
So I am trying to design a text based adventure game for one of my classes. I have the movement from room to room down, but have been struggling when it comes to getting items added to the inventory for the escape. At first when I tried to enter “get ‘item’” I was prompted with ‘invali…
Query S3 from Python
I am using python to send a query to Athena and get table DDL. I am using start_query_execution and get_query_execution functions in the awswrangler package. The code above creates a dict object that stores query results in an s3 link. The link can be accessed by res[‘ResultConfiguration’][‘…
Adding CSS loader to HTML button click
I’m trying to add a “loader” while my flask application runs a task. Here is my HTML for for my button Here is the CSS that I’ve added: Any ideas on how to call this correctly? Answer Make it visible from the start, without ever showing it with javascript. Then hide it with js like so:…