Skip to content

Commit 4b40832

Browse files
authored
Update faq.mdx
resolve conflict
1 parent caba40f commit 4b40832

File tree

1 file changed

+0
-25
lines changed
  • src/content/docs/browser-rendering

1 file changed

+0
-25
lines changed

src/content/docs/browser-rendering/faq.mdx

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -54,31 +54,6 @@ There is no fixed limit on the number of requests per browser session. A single
5454

5555
This error typically occurs because your Puppeteer launch is not receiving the Browser binding. To resolve: Pass your Browser binding into `puppeteer.launch`.
5656

57-
### Why can't I use an XPath selector when using Browser Rendering with Puppeteer?
58-
59-
Currently it is not possible to use Xpath to select elements since this poses a security risk to Workers.
60-
61-
As an alternative, try to use a css selector or `page.evaluate`. For example:
62-
63-
```ts
64-
const innerHtml = await page.evaluate(() => {
65-
return (
66-
// @ts-ignore this runs on browser context
67-
new XPathEvaluator()
68-
.createExpression("/html/body/div/h1")
69-
// @ts-ignore this runs on browser context
70-
.evaluate(document, XPathResult.FIRST_ORDERED_NODE_TYPE).singleNodeValue
71-
.innerHTML
72-
);
73-
});
74-
```
75-
76-
:::note
77-
78-
Keep in mind that `page.evaluate` can only return primitive types like strings, numbers, etc. Returning an `HTMLElement` will not work.
79-
80-
:::
81-
8257
### `Error processing the request: Unable to create new browser: code: 429: message: Browser time limit exceeded for today`
8358

8459
This error indicates you have hit the daily browser-instance limit on the Workers Free plan. [Free-plan accounts are capped at free plan limit is 10 minutes of browser use a day](/browser-rendering/platform/limits/#workers-free) once you exceed those, further creation attempts return a 429 until the next UTC day.

0 commit comments

Comments
 (0)