[wtr-general] Re: Compare HTML with HTML in a file
Useful infos. Thank you, Dan On Apr 10, 11:31 pm, dt_nz wrote: > # I am using IMAP to get the email body in a string > > @email = Net::IMAP.new(dest_host, dest_port, dest_ssl) > @email.login(dest_user, dest_pass) > email_html_string = @email.fetch(@current_msg_id, "(BODY[TEXT])")[0] > > # Then parsing the string using nokogiri > > Nokogiri::HTML.parse(email_html_string) > > # There may be better ways, but hey, thats what I have so far :) -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
[wtr-general] Re: Compare HTML with HTML in a file
# I am using IMAP to get the email body in a string @email = Net::IMAP.new(dest_host, dest_port, dest_ssl) @email.login(dest_user, dest_pass) email_html_string = @email.fetch(@current_msg_id, "(BODY[TEXT])")[0] # Then parsing the string using nokogiri Nokogiri::HTML.parse(email_html_string) # There may be better ways, but hey, thats what I have so far :) -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
[wtr-general] Re: Compare HTML with HTML in a file
I'm sorry, ignore sanitize since you want to compare html. On Apr 6, 4:49 pm, Dan Claudiu Pop wrote: > Hello, > > You can also use sanitize gem to remove html (https://github.com/ > rgrove/sanitize) > Can you post some snippets how you implemented this ? > I would like to do something similar in my scripts. > > Best regards, > Dan > > On Apr 5, 3:03 am, dt_nz wrote: > > > for anyone who is inrested, I just found I should be using Nokogiri > > (http://nokogiri.org/Nokogiri.html) -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
[wtr-general] Re: Compare HTML with HTML in a file
Hello, You can also use sanitize gem to remove html (https://github.com/ rgrove/sanitize) Can you post some snippets how you implemented this ? I would like to do something similar in my scripts. Best regards, Dan On Apr 5, 3:03 am, dt_nz wrote: > for anyone who is inrested, I just found I should be using Nokogiri > (http://nokogiri.org/Nokogiri.html) -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
[wtr-general] Re: Compare HTML with HTML in a file
for anyone who is inrested, I just found I should be using Nokogiri (http://nokogiri.org/Nokogiri.html) -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
[wtr-general] Re: Compare HTML with HTML in a file
Am using the imap class as part of my watir tests, but yes, will try the general group. Ta. -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
[wtr-general] Re: Compare HTML with HTML in a file
I'm not sure how this is Watir related. You may have better luck asking a general Ruby users group. On Apr 4, 12:15 am, dt_nz wrote: > Hi > I am using imap to retrieve email, and want to compare the data (which > is retrieved as a string but contains html) with html stored in a > file. If the data does not match my expected, I would like to find > the differences, and format the html so its readable. > > Anyone know of any good formaters, or html comparators. I had a look > at html tidy, but I cant find how to set tidy lib path (in the rdoc > its Tidy.path = '/usr/lib/tidylib.so', but I cant find this file in my > ruby directory as I am using windows) > > Thanks in advance -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com