Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
BeautifulSoup help
#1
Hi!
1# I have problem with BeautifulSoup. I have this site thats only text (there's no body or anything) and its coded like this:
{
"python": {
"python": {
"python": {
"python": |number|;

"python": "python",

"python": "python",

"python": "python",

"python": "python"
},
And all site is text like this. So i got out it to python with request and Beautiful Soup but when i print it it stays like its on site and idk how to get out that number.



2# And how do i make it update every 500ms so it can ran with another code. I though about loop but when there's loop in program it wont run another loop that needs that data. What i need is loop that does it self every X seconds where x is number that updates in unknown time.
Reply
#2
It looks you are dealing with JSON. Have a look at the docs or find a tutorial how to work with JSON (e.g. documentation for json module), incl. with requests (see JSON Response Content)
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020