Python Automation , BH etc Study/Beginners group ?

divok

Senior Member
Joined
Jul 21, 2010
Messages
1,071
Reaction score
656
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 ?
 
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.
 
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.
 
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.
 
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 :)
 
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.

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.
 
Do you know any library with js browser for python?

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.
 
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.

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 ?
 
Back
Top