Grab all of the href links from a Page

Posted by Jessica Tue, 06 Feb 2007 17:49:00 GMT

Use Rubyful Soup to get all of the hyperlinks on a page…

soup = BeautifulSoup.new(page_content)
result = soup.find_all('a')
result.each { |tag| 
  urls[i] = tag['href']
  if urls[i].to_s.slice(0,1) != 'h' then
          #add first part of url to href link if link is internal
          urls[i] = home + urls[i]
  end
  i = i + 1
}

HTML Basics

Posted by Jessica Sat, 28 Oct 2006 06:01:00 GMT

What is the easiest way to teach someone some basic HTML?

An increasing number of people are becoming interested in activities that requires some basic knowledge of HTML, like blogging, forum posting and email writing. If someone comes to you asking for help learning HTML, you can suggest the following steps:

  1. Download and Install an HTML editor (like HTML-kit, Nvu, Bluefish)
  2. Create a blank HTML document
  3. Try stuff. Press buttons.
  4. Insert the folowing examples into the body of the document (that is directly after you see the following tag: <body>

Sample code

Link to Google <a href="http://www.google.com">Google.com</a>
Let people Email you <a href="mailto:jowensbysandifer@gmail.com">Email me</a>
Insert an Image <img src="location/of/file.bmp" alt="description of photo" width="200" style="border: none;"/>
New Line Break
<br />
Horizontal Line Break Like this:
<hr />
Bold Type <b>Bold Type</b>
Italics <i>Italics</i>
<h1>Heading1</h1>
<h2>Heading2</h2>
A New Paragraph <p style="font: 12px; text-align: center">A New Paragraph</p>
  • Item 1
  • Item 2
<ul> <li>Item 1</li> <li>Item 2</li> </ul>
<div style="float:left;"> Text you want to style or place in a particular part of the page </div>

Change the background color of the page
<Body Bgcolor="#FFFFFF">

designed by jowensbysandifer