[ameli] Detect CGU Validation prompt
From time to time, it may be possible that the website asks you to validate
a new set of contract ("CGU").
This MR detects the situation and exits with an ActionNeeded
exception with
the proper message coming from the page.
(!) Note : I had to patch weboob/browser/pages.py
- the META REFRESH detection
part, because some page in ameli is strangely written (a <head>
in the <body>
)
but it seems that HTML5 parsing allows the handling of <meta>
in a body.
I wasn't able to make lxml detect the second parent <head>
, so I had to remove
the fact that <meta>
had to be a descendent of a <head>
tag.
Cf https://html.spec.whatwg.org/multipage/parsing.html#parsing-main-inbody