Displaying 1 result from an estimated 1 matches for "page_cont".
Did you mean:
page_count
2006 Jun 23
1
rubyful_soup works fine as an RB file but bugs in Rails
This is the code:
1 require ''rubyful_soup''
2 require ''open-uri''
3
4 url = "http://www.google.com/search?q=ruby"
5 open(url) {
6 |page| page_content = page.read()
7 soup = BeautifulSoup.new(page_content)
8 result = soup.find_all(''a'', :attrs => {''class'' => ''l''})
9 result.each { |tag| puts tag[''href''] }
10 }
it works fine when i ran it: ruby rfs.rb
but when...