-
-
Save phillipadsmith/f5416dfd0e90ee4b4775 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Works, i.e., the body is there, but the HTML is a mess: | |
perl -Mojo -E 'say g("foxnews.com")->body' | |
# Doesn't work: not able to find the title tag | |
perl -Mojo -E 'say g("foxnews.com")->dom->at("title")->text' | |
Can't call method "text" on an undefined value at -e line 1. | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
perl -Mojo -E 'say g("foxnews.com")->tap(sub { shift->headers->content_type("text/html") })->dom->at("title")->text'