Skip to first unread message

noli emeterio

Jul 6, 2020, 6:50:34 AM7/6/20
to nokogiri-talk
Im new in using Ruby and gems. 

I was given a task to run scripts using Ruby. and im encountering this error,

  undefined method `html_part' for #<Email:0x007fa2ac2c3f98>.

An error occurred in a `before(:suite)` hook.
Failure/Error: link = Nokogiri::HTML(mail.html_part.body.to_s).xpath("//a[text()=\"#{link_text}\"]")

Not sure what is wrong here.. any help?

Mike Dalessio

Jul 6, 2020, 7:10:00 AM7/6/20
to nokogiri-talk
Hi Noli,

Thanks for asking this question, I'll try to help.

I'm not sure this has anything to do with Nokogiri. This code is calling the method `#html_part` on the object named `mail` which appears to be of type `Email`. This error message is telling us that the method `#html_part` isn't defined on that object.

Maybe you can take a look at the `mail` object -- its type and how it was created -- to resolve this?

You received this message because you are subscribed to the Google Groups "nokogiri-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit

noli emeterio

Jul 7, 2020, 7:48:18 PM7/7/20
to nokogiri-talk
Thanks Mike! i have looked into the script and it is not Nokogiri related. 
Reply all
Reply to author
0 new messages