(self)
| 27 | LINK_PATTERN = r'<input .+?readonly="" value="\s*(.+?)" type="text">' |
| 28 | |
| 29 | def get_links(self): |
| 30 | baseurl = self.req.http.lastEffectiveURL |
| 31 | url, inputs = self.parse_html_form() |
| 32 | |
| 33 | if ">Enter your password.<" in self.data: |
| 34 | password = self.get_password() |
| 35 | if not password: |
| 36 | self.fail(_("Password required")) |
| 37 | |
| 38 | inputs['Pass1'] = password |
| 39 | |
| 40 | elif "Enter Captcha" in self.data: |
| 41 | m = re.search(r'<img src="(.+?)"', self.data) |
| 42 | if m is not None: |
| 43 | captcha_code = self.captcha.decrypt( |
| 44 | m.group(1), input_type="jpeg") |
| 45 | inputs['security_code'] = captcha_code |
| 46 | |
| 47 | else: |
| 48 | return [] |
| 49 | |
| 50 | else: |
| 51 | return [] |
| 52 | |
| 53 | self.data = self.load(baseurl, post=inputs, ref=baseurl) |
| 54 | |
| 55 | if "You have entered an incorrect password." in self.data: |
| 56 | self.fail(_("Wrong password")) |
| 57 | |
| 58 | elif "Your filled the captcha wrongly!" in self.data: |
| 59 | self.retry_captcha() |
| 60 | |
| 61 | return re.findall(self.LINK_PATTERN, self.data) |
nothing calls this directly
no test coverage detected