# Standard Functions

The various browser automation capabilities covered by these tools are fully supported in our **Browser API**. This means that during use, you can directly consult the official documentation of the corresponding technology—all features are seamlessly compatible and can be smoothly invoked, making it easier and more convenient to obtain reliable technical support.

### **Tech Stack**

[**Puppeteer**](https://pptr.dev/api/puppeteer.puppeteernode)

{% tabs %}
{% tab title="New Page" %}

```sh
const page = await page.newPage();  
await page.goto('https://example.com');  
```

{% endtab %}

{% tab title="Get Screenshot" %}

```python
await page.screenshot({ path: 'screenshot.png', fullPage: true });
```

{% endtab %}

{% tab title="Get HTML" %}

```csharp
const page = await browser.newPage();  
await page.goto('https://example.com');  
const html = await page.content();
```

{% endtab %}

{% tab title="Click on Element" %}

```go
// Wait and click on first result.
await page.locator('.devsite-result-item-link').click()
```

{% endtab %}
{% endtabs %}

[**Selenium**](https://www.selenium.dev/documentation/)

{% tabs %}
{% tab title="Python" %}

```python

# Start the session
driver = webdriver.Chrome()

# Take action on browser
driver.get("https://www.selenium.dev/selenium/web/web-form.html")

# Request browser information
title = driver.title
driver.implicitly_wait(0.5)

#Find an element
text_box = driver.find_element(by=By.NAME, value="my-text")
submit_button = driver.find_element(by=By.CSS_SELECTOR, value="button")

# Take action on element
text_box.send_keys("Selenium")
submit_button.click()

# Request element information
message = driver.find_element(by=By.ID, value="message")
text = message.text

# End the session
driver.quit()
```

{% endtab %}

{% tab title="NodeJS" %}

```glimmer-js
 // Start the Browser
 driver = await new Builder().forBrowser(Browser.CHROME).build();
 
 // GOTO UTL on browser
 await driver.get('https://www.selenium.dev/selenium/web/web-form.html');
 
 // Request browser information
 let title = await driver.getTitle();
 
 // Waiting
 await driver.manage().setTimeouts({implicit: 500});
 
 // Find an element
 let textBox = await driver.findElement(By.name('my-text'));
 let submitButton = await driver.findElement(By.css('button'));

 // Take action on element
 await textBox.sendKeys('Selenium');
 await submitButton.click();
 
 // Request element information   
 let message = await driver.findElement(By.id('message'));
 let value = await message.getText();
 
 // End the session   
 await driver.quit();
```

{% endtab %}
{% endtabs %}

### **Run**

\
Save the following code (don’t forget to enter your credentials!) and run it using the commands below:

{% tabs %}
{% tab title="Python" %}

```python

# Start the session
driver = webdriver.Chrome()

# Take action on browser
driver.get("https://www.selenium.dev/selenium/web/web-form.html")

# Request browser information
title = driver.title
driver.implicitly_wait(0.5)

#Find an element
text_box = driver.find_element(by=By.NAME, value="my-text")
submit_button = driver.find_element(by=By.CSS_SELECTOR, value="button")

# Take action on element
text_box.send_keys("Selenium")
submit_button.click()

# Request element information
message = driver.find_element(by=By.ID, value="message")
text = message.text

# End the session
driver.quit()


```

{% endtab %}

{% tab title="NodeJS" %}

```glimmer-js

 // Start the Browser
 driver = await new Builder().forBrowser(Browser.CHROME).build();
 
 // GOTO UTL on browser
 await driver.get('https://www.selenium.dev/selenium/web/web-form.html');
 
 // Request browser information
 let title = await driver.getTitle();
 
 // Waiting
 await driver.manage().setTimeouts({implicit: 500});
 
 // Find an element
 let textBox = await driver.findElement(By.name('my-text'));
 let submitButton = await driver.findElement(By.css('button'));

 // Take action on element
 await textBox.sendKeys('Selenium');
 await submitButton.click();
 
 // Request element information   
 let message = await driver.findElement(By.id('message'));
 let value = await message.getText();
 
 // End the session   
 await driver.quit();
```

{% endtab %}
{% endtabs %}

If you need further assistance or explanations, feel free to contact us at: [**support@thordata.com**](https://mailto:support@thordata.com/).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://doc.thordata.com/doc/scraping/scraping-browser/standard-functions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
