I have printer HTML on my console now how to separate the tag like meta or link and How to analyse it for SEO perpose

Html { errors: , quirks_mode: NoQuirks, tree: Tree { vec: [Node { parent: None, prev_sibling: None, next_sibling: None, children: Some((NodeId(2), NodeId(3))), value: Document }, Node { parent: Some(NodeId(1)), prev_sibling: None, next_sibling: Some(NodeId(3)), children: None, value: Doctype() }, Node { parent: Some(NodeId(1)), prev_sibling: Some(NodeId(2)), next_sibling: None, children: Some((NodeId(4), NodeId(17))), value: Element() }, Node { parent: Some(NodeId(3)), prev_sibling: None, next_sibling: Some(NodeId(17)), children: Some((NodeId(5), NodeId(15))), value: Element() }, Node { parent: Some(NodeId(4)), prev_sibling: None, next_sibling: Some(NodeId(6)), children: None, value: Element() }, Node { parent: Some(NodeId(4)), prev_sibling: Some(NodeId(5)), next_sibling: Some(NodeId(7)), children: None, value: Element() }, Node { parent: Some(NodeId(4)), prev_sibling: Some(NodeId(6)), next_sibling: Some(NodeId(9)), children: Some((NodeId(8), NodeId(8))), value: Element() }, Node { parent: Some(NodeId(7)), prev_sibling: None,

You have dumped an unformatted pile of a debug representation. That is not a question. Your title isn't helpful at all, either.

Please make some effort describing what your problem and requirements are, how you got the results so far, what crates you are using, and what concrete errors – if any – you have got. As-is, it's not realistically possible to help you.


i used scraper = "0.17.1"
reqwest = "0.11.20"

I wanted to separate tags from HTML so how can I do it?

Scraper can parse CSS selectors, so you can select the HTML elements that you are interested in this way.
You can read more in the documentation for the crate: scraper - Rust.


any other ways to do it? Because i got these kind of html , so how can i seperate the tag data any idea?


) }, Node { parent: Some(NodeId(221)), prev_sibling: None, next_sibling: Some(NodeId(224)), children: Some((NodeId(223), NodeId(223))), value: Element() }, Node { parent: Some(NodeId(222)), prev_sibling: None, next_sibling: None, children: None, value: Text("Advertising") }, Node { parent: Some(NodeId(221)), prev_sibling: Some(NodeId(222)), next_sibling: Some(NodeId(226)), children: Some((NodeId(225), NodeId(225))), value: Element() }, Node { parent: Some(NodeId(224)), prev_sibling: None, next_sibling: None, children: None, value: Text("Business Solutions") }, Node { parent: Some(NodeId(221)), prev_sibling: Some(NodeId(224)), next_sibling: Some(NodeId(228)), children: Some((NodeId(227), NodeId(227))), value: Element() }, Node { parent: Some(NodeId(226)), prev_sibling: None, next_sibling: None, children: None, value: Text("About Google") }, Node { parent: Some(NodeId(221)), prev_sibling: Some(NodeId(226)), next_sibling: None, children: Some((NodeId(229), NodeId(229))), value: Element() }, Node { parent: Some(NodeId(228)), prev_sibling: None, next_sibling: None, children: None, value: Text("Google.co.in") }, Node { parent: Some(NodeId(219)), prev_sibling: Some(NodeId(220)), next_sibling: None, children: Some((NodeId(231), NodeId(235))), value: Element(

) }, Node { parent: Some(NodeId(230)), prev_sibling: None, next_sibling: Some(NodeId(232)), children: None, value: Text("© 2023 - ") }, Node { parent: Some(NodeId(230)), prev_sibling: Some(NodeId(231)), next_sibling: Some(NodeId(234)), children: Some((NodeId(233), NodeId(233))), value: Element() }, Node { parent: Some(NodeId(232)), prev_sibling: None, next_sibling: None, children: None, value: Text("Privacy") }, Node { parent: Some(NodeId(230)), prev_sibling: Some(NodeId(232)), next_sibling: Some(NodeId(235)), children: None, value: Text(" - ") }, Node { parent: Some(NodeId(230)), prev_sibling: Some(NodeId(234)), next_sibling: None, children: Some((NodeId(236), NodeId(236))), value: Element() }, Node { parent: Some(NodeId(235)), prev_sibling: None, next_sibling: None, children: None, value: Text("Terms") }, Node { parent: Some(NodeId(17)), prev_sibling: Some(NodeId(148)), next_sibling: Some(NodeId(239)), children: Some((NodeId(238), NodeId(238))), value: Element() }, Node { parent: Some(NodeId(237)), prev_sibling: None, next_sibling: None, children: None, value: Text("(function(){window.google.cdo={height:757,width:1440};(function(){var a=window.innerWidth,b=window.innerHeight;if(!a||!b){var c=window.document,d="CSS1Compat"==c.compatMode?c.documentElement:c.body;a=d.clientWidth;b=d.clientHeight}\nif(a&&b&&(a!=google.cdo.width||b!=google.cdo.height)){var e=google,f=e.log,g="/client_204?&atyp=i&biw="+a+"&bih="+b+"&ei="+google.kEI,h="",k=,l=void 0!==window.google&&void 0!==window.google.kOPI&&0!==window.google.kOPI?window.google.kOPI:null;null!=l&&k.push(["opi",l.toString()]);for(var m=0;m<k.length;m++){if(0===m||0<m)h+="&";h+=k[m][0]+"="+k[m][1]}f.call(e,"","",g+h)};}).call(this);})();") }, Node { parent: Some(NodeId(17)), prev_sibling: Some(NodeId(237)), next_sibling: Some(NodeId(240)), children: None, value: Text(" ") }, Node { parent: Some(NodeId(17)), prev_sibling: Some(NodeId(239)), next_sibling: Some(NodeId(242)), children: Some((NodeId(241), NodeId(241))), value: Element() }, Node { parent: Some(NodeId(240)), prev_sibling: None, next_sibling: None, children: None, value: Text("(function(){google.xjs={ck:'xjs.hp.UpirPaSi0NY.L.X.O',cs:'ACT90oEAoou1m7RUYPoz88YLezIN6wj1pw',cssopt:false,csss:'ACT90oFouYU2LXQfnefHkpdqKeezxOPDYA',excm:,sepcss:false};})();") }, Node { parent: Some(NodeId(17)), prev_sibling: Some(NodeId(240)), next_sibling: Some(NodeId(243)), children: None, value: Text(" ") },

Please format your code snippets with triple back ticks or grave accents (`) so that they become more readable. Also include what are you doing on the code side of things.

1 Like

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.