How to use html-dom-parser - 1 common examples

To help you get started, we’ve selected a few html-dom-parser examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github matthew1232 / stockx-api / src / apis / stockx / user / helpers.js View on Github external
},
      method: 'POST',
      proxy,
      resolveWithFullResponse: true,
      simple: false,
    });

    const { body } = res;

    checkLoginStatus(res);

    let wa;
    let wctx;
    let wresult;
    try {
      const elements = parse(body);

      if (!elements || !elements.length || elements.length !== 1) {
        throw new Error('Invalid login form!');
      }

      const { children } = elements[0];
      
      children.forEach(child => {
        if (child.name === 'input') {
          const { name, value } = child.attribs;
          if (/wa/i.test(name)) {
            wa = value;
          } else if (/wctx/i.test(name)) {
            wctx = decodeHtmlEntity(value);
          } else if (/wresult/i.test(name)) {
            wresult = value;

html-dom-parser

HTML to DOM parser.

MIT
Latest version published 6 days ago

Package Health Score

85 / 100
Full package analysis

Popular html-dom-parser functions