Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

typos

  • Loading branch information...
commit 2c719bc10420d5061003700e6906b852551250dc 1 parent 2b728f3
@Erkan-Yilmaz Erkan-Yilmaz authored
Showing with 15 additions and 15 deletions.
  1. +2 −2 EXAMPLES.rdoc
  2. +13 −13 GUIDE.rdoc
View
4 EXAMPLES.rdoc
@@ -83,7 +83,7 @@ Upload a file to flickr.
== Pluggable Parsers
-Lets say you want HTML pages to automatically be parsed with Rubyful Soup.
+Let's say you want HTML pages to automatically be parsed with Rubyful Soup.
This example shows you how:
require 'rubygems'
@@ -119,7 +119,7 @@ Beautiful Soup for that page.
Mechanize#transact runs the given block and then resets the page history. I.e.
after the block has been executed, you're back at the original page; no need
-count how many times to call the back method at the end of a loop (while
+to count how many times to call the back method at the end of a loop (while
accounting for possible exceptions).
This example also demonstrates subclassing Mechanize.
View
26 GUIDE.rdoc
@@ -26,7 +26,7 @@ Mechanize stored any cookies that were set, and followed any redirects that
google may have sent. The agent gave us back a page that we can use to
scrape data, find links to click, or find forms to fill out.
-Next, lets try finding some links to click.
+Next, let's try finding some links to click.
== Finding Links
@@ -34,14 +34,14 @@ Mechanize returns a page object whenever you get a page, post, or submit a
form. When a page is fetched, the agent will parse the page and put a list
of links on the page object.
-Now that we've fetched google's homepage, lets try listing all of the links:
+Now that we've fetched google's homepage, let's try listing all of the links:
page.links.each do |link|
puts link.text
end
We can list the links, but Mechanize gives a few shortcuts to help us find a
-link to click on. Lets say we wanted to click the link whose text is 'News'.
+link to click on. Let's say we wanted to click the link whose text is 'News'.
Normally, we would have to do this:
page = agent.page.links.find { |l| l.text == 'News' }.click
@@ -65,13 +65,13 @@ Or chain them together to find a link with certain text and certain href:
page.link_with(:text => 'News', :href => '/something')
-These shortcuts that mechanize provides are available on any list that you
+These shortcuts that Mechanize provides are available on any list that you
can fetch like frames, iframes, or forms. Now that we know how to find and
-click links, lets try something more complicated like filling out a form.
+click links, let's try something more complicated like filling out a form.
== Filling Out Forms
-Lets continue with our google example. Here's the code we have so far:
+Let's continue with our google example. Here's the code we have so far:
require 'rubygems'
require 'mechanize'
@@ -83,17 +83,17 @@ that has a couple buttons and a few fields:
pp page
-Now that we know the name of the form, lets fetch it off the page:
+Now that we know the name of the form, let's fetch it off the page:
google_form = page.form('f')
Mechanize lets you access form input fields in a few different ways, but the
most convenient is that you can access input fields as accessors on the
-object. So lets set the form field named 'q' on the form to 'ruby mechanize':
+object. So let's set the form field named 'q' on the form to 'ruby mechanize':
google_form.q = 'ruby mechanize'
-To make sure that we set the value, lets pretty print the form, and you should
+To make sure that we set the value, let's pretty print the form, and you should
see a line similar to this:
#<Mechanize::Field:0x1403488 @name="q", @value="ruby mechanize">
@@ -109,7 +109,7 @@ clicking the 'Google Search' button. If we had submitted the form without
a button, it would be like typing in the text field and hitting the return
button.
-Lets take a look at the code all together:
+Let's take a look at the code all together:
require 'rubygems'
require 'mechanize'
@@ -121,7 +121,7 @@ Lets take a look at the code all together:
page = agent.submit(google_form)
pp page
-Before we go on to screen scraping, lets take a look at forms a little more
+Before we go on to screen scraping, let's take a look at forms a little more
in depth. Unless you want to skip ahead!
== Advanced Form Techniques
@@ -132,11 +132,11 @@ text input fields. Select fields are very similar to text fields, but they
have many options associated with them. If you select one option, mechanize
will de-select the other options (unless it is a multi select!).
-For example, lets select an option on a list:
+For example, let's select an option on a list:
form.field_with(:name => 'list').options[0].select
-Now lets take a look at checkboxes and radio buttons. To select a checkbox,
+Now let's take a look at checkboxes and radio buttons. To select a checkbox,
just check it like this:
form.checkbox_with(:name => 'box').check
Please sign in to comment.
Something went wrong with that request. Please try again.