Jump to content


Toggle shoutbox Shoutbox Open the Shoutbox in a popup

@  David : (06 October 2018 - 04:47 AM) hi every one that joined ive been away
@  David : (06 October 2018 - 04:45 AM) cyborg bro i cannot send you messages. it says i cant what the , i was going to swear then but how the deal are you. i will give you my email
@  Cyborg : (03 October 2018 - 02:51 AM) aLLNuTs would like to wish cthow1002 a happy birthday.
@  Cyborg : (20 September 2018 - 12:04 AM) aLLNuTs would like to wish DarbyJaege a happy birthday.
@  Cyborg : (02 September 2018 - 05:34 AM) aLLNuTs would like to wish Blooodsugar a happy birthday.
@  Cyborg : (16 August 2018 - 12:51 AM) aLLNuTs would like to wish WilmerWall a happy birthday.
@  Cyborg : (11 August 2018 - 01:05 PM) aLLNuTs would like to wish TillyFisch a happy birthday.
@  GamerZfury : (24 June 2018 - 01:59 AM) Welcome to our forum ErzestLab :)
@  David : (23 June 2018 - 08:42 PM) Hello everyone
@  Cyborg : (19 June 2018 - 01:34 AM) hi David
@  GamerZfury : (15 June 2018 - 07:40 PM) Welcome to our forum StephenDup :)
@  GamerZfury : (15 June 2018 - 03:44 AM) Welcome to our forum shokimi :)
@  GamerZfury : (13 June 2018 - 02:24 PM) Welcome to our forum PhilomenaM :)
@  GamerZfury : (12 June 2018 - 04:03 PM) Welcome to our forum yvvafq :)
@  GamerZfury : (12 June 2018 - 11:46 AM) Welcome to our forum MaryellenB :)
@  GamerZfury : (12 June 2018 - 09:01 AM) Welcome to our forum Petra26720 :)
@  GamerZfury : (11 June 2018 - 10:37 PM) Welcome to our forum Syreeta939 :)
@  GamerZfury : (11 June 2018 - 08:07 PM) Welcome to our forum AugustaWis :)
@  GamerZfury : (11 June 2018 - 05:30 AM) Welcome to our forum RobertTendy :)
@  GamerZfury : (08 June 2018 - 08:42 AM) Welcome to our forum Wizliammom :)

Register on GamerZFuRY!


Sign In 

Create Account
Welcome to GamerZFuRY !!! Like most online communities you must register to post or access the Downloads section. But don't worry this is a simple FREE process that requires minimal information for you to signup. Be apart of GamerZFuRY by signing in or creating an account.
 
Guest Message by DevFuse

[Python] Working with mechanize module-basics


  • Please log in to reply
No replies to this topic

#1 Cyborg

Cyborg

    Administrator

  • Administrators
  • 246 posts
  • LocationEarth
  • :

Posted 07 March 2015 - 08:14 AM

Browsing with Mechanize

The mechanize module in Python is similar to perl WWW:Mechanize.

It gives you a browser like object to interact with web pages.

Here is an example on how to use it in a program.

Please Login or Register to see this Hidden Content

Follow second link with element text matching regular expression

Please Login or Register to see this Hidden Content

To get the response code from a website, you can the response.code

Please Login or Register to see this Hidden Content

Get all forms from a website

Please Login or Register to see this Hidden Content

I found this post at

Please Login or Register to see this Hidden Content

that very accurate describes how
to emulate a browser in Python using mechanize.

Browsing with Python (

Please Login or Register to see this Hidden Content

)

Please Login or Register to see this Hidden Content

Ignore robots.txt

Please Login or Register to see this Hidden Content

Google demands a user-agent that isn't a robot

Please Login or Register to see this Hidden Content

Retrieve the Google home page, saving the response

Please Login or Register to see this Hidden Content

Select the search box and search for 'foo'

Please Login or Register to see this Hidden Content

Get the search results

Please Login or Register to see this Hidden Content

Find the link to foofighters.com; why did we run a search?

Please Login or Register to see this Hidden Content

Please Login or Register to see this Hidden Content

Print the site

Please Login or Register to see this Hidden Content

The script above is split up to make it easier to read

Its time for GamerZFuRY to become famous!!





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users