Jump to content

Web Scraper

- - - - -

  • Please log in to reply
4 replies to this topic

#1
ThePistonDoctor

ThePistonDoctor

    Newbie

  • Members
  • Pip
  • 6 posts
Nevermind - thanks :)

Edited by ThePistonDoctor, 07 November 2011 - 04:11 PM.


#2
ThePistonDoctor

ThePistonDoctor

    Newbie

  • Members
  • Pip
  • 6 posts
edit: removing source

Edited by ThePistonDoctor, 07 November 2011 - 04:10 PM.


#3
Flying Dutchman

Flying Dutchman

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 890 posts
  • Location:::1
You could use regular expressions to get all the numbers from the line, or if you know for sure that there will always be n (= 3) numbers in the line, you could write something like that:
number1, number2, number3 = map(int, line.replace(",", "").split(-2:))
Or you could go with your idea, by splitting the line at space, iterating through each element and checking whether it's number or not. You can use isinstance function, or try with exceptions.
A conclusion is where you got tired of thinking.
#define class struct    // All is public.

#4
ThePistonDoctor

ThePistonDoctor

    Newbie

  • Members
  • Pip
  • 6 posts
edit: removing source

Edited by ThePistonDoctor, 07 November 2011 - 04:10 PM.


#5
Flying Dutchman

Flying Dutchman

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 890 posts
  • Location:::1
I guess now you could add some graphical user interface, to make it look shiny. I recommend PyQt, there are many others though but so far I've only worked with this one and it's really nice.
A conclusion is where you got tired of thinking.
#define class struct    // All is public.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users