@letsscrapedata/controller 0.0.21 → 0.0.22

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/dist/index.cjs CHANGED
@@ -16990,9 +16990,13 @@ var CheerioElement = class _CheerioElement {
16990
16990
  // src/cheerio/page.ts
16991
16991
  var CheerioPage = class extends import_node_events7.default {
16992
16992
  #document;
16993
- constructor(html3 = "") {
16993
+ constructor(html3 = "", isHtml2 = true) {
16994
16994
  super();
16995
- this.#document = load(html3).root();
16995
+ if (isHtml2) {
16996
+ this.#document = load(html3).root();
16997
+ } else {
16998
+ this.#document = load(html3, { xml: true }).root();
16999
+ }
16996
17000
  }
16997
17001
  async bringToFront() {
16998
17002
  throw new Error("Not supported in CheerioPage.");
@@ -17077,8 +17081,12 @@ var CheerioPage = class extends import_node_events7.default {
17077
17081
  isFree() {
17078
17082
  throw new Error("Not supported in CheerioPage.");
17079
17083
  }
17080
- load(html3) {
17081
- this.#document = load(html3).root();
17084
+ load(html3, isHtml2 = true) {
17085
+ if (isHtml2) {
17086
+ this.#document = load(html3).root();
17087
+ } else {
17088
+ this.#document = load(html3, { xml: true }).root();
17089
+ }
17082
17090
  return true;
17083
17091
  }
17084
17092
  async localStroage() {
package/dist/index.d.cts CHANGED
@@ -812,7 +812,7 @@ interface LsdPage extends EventEmitter {
812
812
  /**
813
813
  * valid only in CheerioPage
814
814
  */
815
- load(html: string): boolean;
815
+ load(html: string, isHtml?: boolean): boolean;
816
816
  localStroage(): Promise<LocalStorageOrigin[]>;
817
817
  mainFrame(): AllFrame;
818
818
  maximizeViewport(): Promise<boolean>;
@@ -1174,7 +1174,7 @@ declare class PuppeteerElement implements LsdElement {
1174
1174
 
1175
1175
  declare class CheerioPage extends EventEmitter implements LsdPage {
1176
1176
  #private;
1177
- constructor(html?: string);
1177
+ constructor(html?: string, isHtml?: boolean);
1178
1178
  bringToFront(): Promise<boolean>;
1179
1179
  browserContext(): LsdBrowserContext;
1180
1180
  clearCookies(): Promise<boolean>;
@@ -1191,7 +1191,7 @@ declare class CheerioPage extends EventEmitter implements LsdPage {
1191
1191
  goto(): Promise<boolean>;
1192
1192
  id(): string;
1193
1193
  isFree(): boolean;
1194
- load(html: string): boolean;
1194
+ load(html: string, isHtml?: boolean): boolean;
1195
1195
  localStroage(): Promise<LocalStorageOrigin[]>;
1196
1196
  mainFrame(): AllFrame;
1197
1197
  maximizeViewport(): Promise<boolean>;
package/dist/index.d.ts CHANGED
@@ -812,7 +812,7 @@ interface LsdPage extends EventEmitter {
812
812
  /**
813
813
  * valid only in CheerioPage
814
814
  */
815
- load(html: string): boolean;
815
+ load(html: string, isHtml?: boolean): boolean;
816
816
  localStroage(): Promise<LocalStorageOrigin[]>;
817
817
  mainFrame(): AllFrame;
818
818
  maximizeViewport(): Promise<boolean>;
@@ -1174,7 +1174,7 @@ declare class PuppeteerElement implements LsdElement {
1174
1174
 
1175
1175
  declare class CheerioPage extends EventEmitter implements LsdPage {
1176
1176
  #private;
1177
- constructor(html?: string);
1177
+ constructor(html?: string, isHtml?: boolean);
1178
1178
  bringToFront(): Promise<boolean>;
1179
1179
  browserContext(): LsdBrowserContext;
1180
1180
  clearCookies(): Promise<boolean>;
@@ -1191,7 +1191,7 @@ declare class CheerioPage extends EventEmitter implements LsdPage {
1191
1191
  goto(): Promise<boolean>;
1192
1192
  id(): string;
1193
1193
  isFree(): boolean;
1194
- load(html: string): boolean;
1194
+ load(html: string, isHtml?: boolean): boolean;
1195
1195
  localStroage(): Promise<LocalStorageOrigin[]>;
1196
1196
  mainFrame(): AllFrame;
1197
1197
  maximizeViewport(): Promise<boolean>;
package/dist/index.js CHANGED
@@ -16970,9 +16970,13 @@ var CheerioElement = class _CheerioElement {
16970
16970
  // src/cheerio/page.ts
16971
16971
  var CheerioPage = class extends EventEmitter7 {
16972
16972
  #document;
16973
- constructor(html3 = "") {
16973
+ constructor(html3 = "", isHtml2 = true) {
16974
16974
  super();
16975
- this.#document = load(html3).root();
16975
+ if (isHtml2) {
16976
+ this.#document = load(html3).root();
16977
+ } else {
16978
+ this.#document = load(html3, { xml: true }).root();
16979
+ }
16976
16980
  }
16977
16981
  async bringToFront() {
16978
16982
  throw new Error("Not supported in CheerioPage.");
@@ -17057,8 +17061,12 @@ var CheerioPage = class extends EventEmitter7 {
17057
17061
  isFree() {
17058
17062
  throw new Error("Not supported in CheerioPage.");
17059
17063
  }
17060
- load(html3) {
17061
- this.#document = load(html3).root();
17064
+ load(html3, isHtml2 = true) {
17065
+ if (isHtml2) {
17066
+ this.#document = load(html3).root();
17067
+ } else {
17068
+ this.#document = load(html3, { xml: true }).root();
17069
+ }
17062
17070
  return true;
17063
17071
  }
17064
17072
  async localStroage() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@letsscrapedata/controller",
3
- "version": "0.0.21",
3
+ "version": "0.0.22",
4
4
  "description": "Unified browser / HTML controller interfaces that support playwright, puppeteer and cheerio",
5
5
  "type": "module",
6
6
  "main": "./dist/index.mjs",