html icon indicating copy to clipboard operation
html copied to clipboard

getElementsByTagName doesn't work on some sites

Open sgehrman opened this issue 3 years ago • 2 comments

I'm scraping a website to get the title and description and other meta data, but it's not working on all sites.

for example: https://www.youtube.com/watch?v=3AIZAGwMRg8

final List<Element> elements = document.head.getElementsByTagName('title');

elements returns []

But other sites work just fine, like https://apple.com

I'm also using:

  final List<Element> metas = document.head.getElementsByTagName('meta');

And on that site, I'm not seeing all the meta tags

sgehrman avatar Aug 25 '20 10:08 sgehrman