Python Forum
struggling with loop/webscrape
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
struggling with loop/webscrape
#5
Thanks guys, i tried a bit and now i figured out what was wrong in my code :)

My code was adding "LISTpg" because i was trying to set variable from page again
As you can see i was using 'page' for both variables, that's why it wasn't working as intended.
page = 'https://mysecretsite.com'
for i in range(1, 4):
    page = f'{page}&LISTpg={i}'
That is correct version :P
page = 'https://mysecretsite.com'
for i in range(1, 4):
    page2 = f'{page}&LISTpg={i}'
Reply


Messages In This Thread
struggling with loop/webscrape - by zarize - Sep-26-2019, 02:28 PM
RE: struggling with loop/webscrape - by perfringo - Sep-26-2019, 03:16 PM
RE: struggling with loop/webscrape - by zarize - Sep-27-2019, 07:33 AM
RE: struggling with loop/webscrape - by perfringo - Sep-27-2019, 08:00 AM
RE: struggling with loop/webscrape - by zarize - Sep-27-2019, 08:44 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Webscrape from my webpage and store in database and send to grafana Armond 2 945 Jul-12-2023, 06:29 PM
Last Post: Armond
  Struggling with Juggling JSON Data SamWatt 7 1,951 May-09-2022, 02:49 AM
Last Post: snippsat
  Syntax errors: Struggling to setup enviroment and load packages AH56 5 2,825 Jun-30-2021, 01:01 PM
Last Post: AH56
  Struggling for the past hour to define function and call it back godlyredwall 2 2,253 Oct-29-2020, 02:45 PM
Last Post: deanhystad
  struggling with != statements CallumRoberts2004 2 1,564 Aug-18-2020, 03:01 PM
Last Post: GOTO10
  I’m Flat out struggling to understand list indexes gr3yali3n 7 2,969 Jul-20-2020, 07:18 PM
Last Post: princetonits
  Struggling with nested list gr3yali3n 3 2,359 Jul-09-2020, 05:30 PM
Last Post: DPaul
  Struggling to exit this while loop fatherted99 5 2,512 Feb-08-2020, 07:46 PM
Last Post: fatherted99
  Struggling with several while loops nsadams87xx 1 1,842 Nov-25-2019, 02:12 AM
Last Post: Larz60+
  Still struggling with np.where... pberrett 1 1,861 May-10-2019, 11:30 AM
Last Post: scidam

Forum Jump:

User Panel Messages

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