in reply to how to print div tag value with a href tag in perl

What is the relevant part of the HTML you're parsing? Also, are you certain that this is a Perl problem at all? I think the problem is mostly related to CSS selectors.

Maybe you want to solve the problem in two steps:

  1. Extract the text that goes before the text you have
  2. Extract the text you have already

The desired output is then constructed by printing the first text and then printing the second text.

Update: After thinking a bit more about your problem, you most likely seem to want to extract just the text of a node and all its children. I would read the Mojo::DOM documentation as I don't know the Mojo API. But most likely, it consists of 1. getting all the children of a node, and 2. getting the text of each child.

  • Comment on Re: how to print div tag value with a href tag in perl