ruby (mechanize , net/http)

V

Vlad Smith

Hi guys.
I`m using mechanize to get some images from the web application. I have
2 problems:
1-st : I can`t catch the links. The whole link looks like <a href =
"https://.../reports/switch_accounts.html?..."See full report</a>

And there`re couple of these that i try to catch with a singe regexp

i tried this :
<code>
final.links_with:)href => %r{/switch_accounts.html/} ).each do |link|
puts link.href, link.text
end
</code>

but it doesn`t display anything, but i`m pretty much sure there`re those
links in the 'final' webpage

The second problem - how can i actually save the images to a selected
folder(assuming i have the links for them)?

Thatnks everybody, any ideas are really appreciated
 
R

Rüdiger Brahns

Hello

If you didn't find it yet:
=> #<MatchData:0xb7e0c8d0>

I don't know mechanize, but str2 is an url your regex (re1) would match.
re2 is the regex that matches your sample url.

Regards, R.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,270
Latest member
TopCryptoTwitterChannels_

Latest Threads

Top