Bob_Smith
(Bob Smith)
1
I am using native ruby api calls to IE without waitr to retrieve
information from google maps.
I am trying to capture the following output which is just a simple
string:
http://maps.google.com/maps/geo?q=123+main+street+ottawa+canada&output=csv
The output is this:
200,8,45.4106089,-75.6788888
How can I capture that information inside a variable since there are
no HTML tags?
This dosn't seem to work:
geo_code = ie.Document.All.tags("")
arton
(arton)
2
Hi
I could get the code by
ie.document.getElementsByTagName('pre').item(0).innerHTML
but at this case, I recomend you to use open-uri, it's more simple and
fast and not depend on Windows.
ex)
require 'open-uri'
csv = nil
open('http://maps.google.com/maps/geo?q=123+main+street+ottawa+canada&output=csv') do |http|
csv = http.read
end
puts "geo_code=#{csv}"
···
--
arton <artonx@yahoo.co.jp>
--------------------------------------
Learn more about breast cancer - Pink Ribbon Campaign 2010
http://yj.pn/JAy9L7
Bob_Smith
(Bob Smith)
3
Thanks for the snippet and alternative solution.
···
On Thu, Oct 14, 2010 at 1:40 PM, arton <artonx@yahoo.co.jp> wrote:
Hi
I could get the code by
ie.document.getElementsByTagName('pre').item(0).innerHTML
but at this case, I recomend you to use open-uri, it's more simple and
fast and not depend on Windows.
ex)
require 'open-uri'
csv = nil
open('http://maps.google.com/maps/geo?q=123+main+street+ottawa+canada&output=csv'\) do |http|
csv = http.read
end
puts "geo_code=#{csv}"
--
arton <artonx@yahoo.co.jp>
--------------------------------------
Learn more about breast cancer - Pink Ribbon Campaign 2010
http://yj.pn/JAy9L7