If I have a html as follows, and I use beautiful soup to parse it, how can I access the lines before <head> element.
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
For instance the standard way to access the head element is soup.head or the body is soup.body. I assume that's because head and body are both standard tags.
Is there a way to access elements before <head>?