fix soup head being None

If the HTML response returns without a head
(e.g. because a permanent redirect)

then soup.head will be None and the page will crash.

We append the script tag only of soup finds a page head.

Signed-off-by: Alex D <ddalex@gmail.com>
Merge pull request #4 from ddalex/fix_soup_head_none

Fix soup head being None