I’m using Ruby, with the Nokogiri module, and i want to get the content of the body without the script elements.
Nokogiri parse uses XPATH or CSS 3.0. XPATH i really dont understand, and i can’t find the CSS selector to achieve my goals.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I don’t think such selection is possible with XPath.
I’m not that familiar with Ruby or Nokogiri, but based on answers to a similar question, you might want to try selecting all script elements from the HTML document and removing them.
Adjust accordingly.