1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Python Automation , BH etc Study/Beginners group ?

Discussion in 'Other Languages' started by divok, Mar 30, 2013.

  1. divok

    divok Senior Member

    Joined:
    Jul 21, 2010
    Messages:
    1,016
    Likes Received:
    634
    Location:
    http://twitter.com/divok
    Hello ,
    I am a python beginner ..... just bought Learning Python 4th edition ....i had completed Dive into python upto 5-6 chapters then lost interest coz it was based on 2.7 .....Anyways I was thinking if someone else could join me in learning python programming ...we could set targets of completing certain topics on daily basis coz it will help us speed up .....otherwise I will just be too lazy .
    Obviously we would lay more emphasis on automation and other BH shit ....since i have a little bit of programming background (c,c++,java,php tough just learnt them didn't do anything great ) I was thinking learning Scrappy(XPath to be learned first) or mechanize side by side to speed up the learning
    We could also share resources , tutorials , doubts etc
    Anyone up for this ?
     
  2. bkshock

    bkshock Newbie

    Joined:
    Mar 13, 2012
    Messages:
    30
    Likes Received:
    12
    As far as learning Scrapy, I'd say just dive into it. You'll figure out the XPaths as you go and the Scrapy site has some great tutorials on them. If you have some programming experience, you can have your first custom scraper working within a couple of hours. I'd also recommend going through "Learn Python The Hard Way" as it'll teach you all of the basics of Python with minimal jibber-jabber about programming, and lots of code snippets.
     
  3. xxNEBer

    xxNEBer Newbie

    Joined:
    Apr 13, 2013
    Messages:
    24
    Likes Received:
    15
    I still use Python 2.7. There's nothing wrong with it.
    I would personally pass on mechanize. It's better to use urllib and urllib2.
     
    • Thanks Thanks x 1
  4. TheRevaN

    TheRevaN Newbie

    Joined:
    Jun 2, 2013
    Messages:
    18
    Likes Received:
    6
    I'm already experienced with python but I wouldn't mind helping you if you need me.

    Here's your first tip:
    Don't read books on python. Read the documentation. It starts with a tutorial that is very well written and you will learn almost 100% of the things you need to know about python.
     
  5. oozyluce

    oozyluce Regular Member

    Joined:
    Jan 26, 2013
    Messages:
    277
    Likes Received:
    231
    Occupation:
    IT Coordinator, Senior Network Administrator
    Location:
    http://www.gaben.tv/
    Home Page:
    Like any other programming language, i find that i learn faster using a problem-solving approach.
    In other words: Start a Phython Project! Let your imagination go wild, start something and when you get stuck read the documentation, lurk Stack Exchange, google your issue or situation and make the best out of it. You'll learn coding experience as well as the language, and, like if you were taking notes, i find that the information you gather sticks much better in your head than if you just read the book :)
     
    • Thanks Thanks x 1
  6. CodingAndStuff

    CodingAndStuff Regular Member

    Joined:
    May 6, 2012
    Messages:
    236
    Likes Received:
    84
    Occupation:
    Swagstronaut
    Location:
    You can't have my bots. Sorry :'(
    Personally I prefer the "Requests" library, which is a REALLY robust wrapper for CookieLib, UrlLib (w/ SSL!), and the JSON lib.

    Code:
    
    response = requests.post("http://site.com/file.php",data = {"username":"bojangles","password":"yoloswag4jesus"}, headers = {"Accept":"*/*"})
    if response.status_code == 200:
        print "We got the page."
        print response.text
    
    
    It handles GET, POST, PUT, DELETE, etc, and also has some other parameters to handle things like proxies and cookies. It is by far the most useful Python class I've used to date.
     
    • Thanks Thanks x 3
  7. steingate

    steingate Registered Member

    Joined:
    Aug 7, 2012
    Messages:
    77
    Likes Received:
    13
    Do you know any library with js browser for python?
     
  8. divok

    divok Senior Member

    Joined:
    Jul 21, 2010
    Messages:
    1,016
    Likes Received:
    634
    Location:
    http://twitter.com/divok
    spynner , tough never used it .
     
  9. Mrbagino

    Mrbagino Newbie

    Joined:
    Nov 10, 2011
    Messages:
    46
    Likes Received:
    9
    Location:
    On this planet
    Home Page:
    Really nice topic :Divok:

    I'am in for this i added you at Skype!
     
  10. weedsmoker

    weedsmoker Junior Member

    Joined:
    May 2, 2011
    Messages:
    190
    Likes Received:
    79
    Headless:
    ghost, spynner or make your own with qtwebkit/pyside libs
    phantomjs/webdriver

    Browser control:
    selenium/webdriver, iec/pamie/icedriver (Internet Explored through com object)

    I'm currently messing with FireFox and mozrepl addon and I've coded my own bindings to comunicate with FF through telnet module with javascript/xpcom. Works nice for heavy javascript/ajax pages.
    I've coded universal bindings for all those libraries over time, and now to switch from one library to other it's just changing one line of code. That's a great time saver when you testing them on sites because every library has some advances over others, so you can easily switch library depending on the site you bot/scrape.
     
  11. krishnap

    krishnap Junior Member

    Joined:
    May 13, 2013
    Messages:
    163
    Likes Received:
    158
    2.7 is the status quo, continue with the book. If you stop there , you wont be able to learn python.

    and one more thing , you learned c,c++,java,php and did not do anything gr8, than you wont be able to do anything gr8 by learning python. Better to learn one language and master it first b4 switching to another one.