@ubaidbinwaris/linkedin 1.0.9 → 1.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ubaidbinwaris/linkedin",
3
- "version": "1.0.9",
3
+ "version": "1.0.10",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -160,10 +160,16 @@ async function loginToLinkedIn(options = {}, credentials = null) {
160
160
  try {
161
161
  logger.info("Attempting to resolve simple checkpoint headlessly...");
162
162
  const simpleResolved = await page.evaluate(async () => {
163
- const buttons = Array.from(document.querySelectorAll('button'));
164
- const targetText = ['Yes', 'Skip', 'Not now', 'Continue', 'Sign in'];
165
- // Find a button with one of these texts
166
- const btn = buttons.find(b => targetText.some(t => b.innerText.includes(t)));
163
+ // Find buttons, links, or elements with button role
164
+ const candidates = Array.from(document.querySelectorAll('button, a, [role="button"], input[type="submit"], input[type="button"]'));
165
+ const targetText = ['Yes', 'Skip', 'Not now', 'Continue', 'Sign in', 'Verify', 'Let’s do it', 'Next'];
166
+
167
+ // Find a candidate with one of these texts
168
+ const btn = candidates.find(b => {
169
+ const text = (b.innerText || b.value || '').trim();
170
+ return targetText.some(t => text.includes(t));
171
+ });
172
+
167
173
  if (btn) {
168
174
  btn.click();
169
175
  return true;
@@ -21,6 +21,7 @@ const defaultLogger = winston.createLogger({
21
21
  transports: [
22
22
  new winston.transports.File({ filename: path.join(logDir, "error.log"), level: "error" }),
23
23
  new winston.transports.File({ filename: path.join(logDir, "combined.log") }),
24
+ new winston.transports.Console() // Output to console
24
25
  ],
25
26
  });
26
27