mirror of
https://github.com/webrecorder/browsertrix-crawler.git
synced 2025-10-19 14:33:17 +00:00
Loosen selectors for login fields in automated profile creation (#638)
Fixes #637 - Username will match if name attribute is one of: user, username, email - Password will match if type is password and name attribute is one of: pass, password This loosens the rules sufficiently to solve the issue with the URL in the linked issue without requiring users to pass custom CSS selectors at this point. It looks like we were also using XPath methods like contains whereas puppeteer expects CSS selectors, hence the syntax change.
This commit is contained in:
parent
151115d46c
commit
fd98033268
2 changed files with 4 additions and 4 deletions
|
@ -266,10 +266,10 @@ async function automatedProfile(
|
|||
|
||||
try {
|
||||
u = await page.waitForSelector(
|
||||
"//input[contains(@name, 'user') or contains(@name, 'email')]",
|
||||
"input[name='user'],input[name='username'],input[name='email']",
|
||||
);
|
||||
p = await page.waitForSelector(
|
||||
"//input[contains(@name, 'pass') and @type='password']",
|
||||
"input[type='password'].input[name='pass'],input[name='password']",
|
||||
);
|
||||
} catch (e) {
|
||||
if (params.debugScreenshot) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue