Uchiha Sasuke
1 subscriber
5 links
Download Telegram
Channel created
Forwarded from Programming & AI Tips 💡 (Moien Tajik)
Browserless | Headless browser automation, without the hosting headaches 🆒

Browserless allows remote clients to connect and execute headless work, all inside of docker. It supports the standard, unforked Puppeteer and Playwright libraries, as well offering REST-based APIs for common actions like data collection, PDF generation and more.

Sample 🐞:
import puppeteer from "puppeteer";

// Try changing this! 👇
const URL = "https://t.me/s/ProgrammingTip";

const main = async () => {
const browser = await puppeteer.connect({
browserWSEndpoint: `wss://chrome.browserless.io`,
});
const page = await browser.newPage();
await page.goto(URL);

return page.screenshot();
}



[ GitHub ] : https://github.com/browserless/browserless
[ Website ] : https://www.browserless.io

〰️〰️〰️〰️〰️〰️
#E2E #Testing #Browserless #Docker
@ProgrammingTip
Please open Telegram to view this post
VIEW IN TELEGRAM
Browserless | Headless browser automation, without the hosting headaches 🆒

Browserless allows remote clients to connect and execute headless work, all inside of docker. It supports the standard, unforked Puppeteer and Playwright libraries, as well offering REST-based APIs for common actions like data collection, PDF generation and more.

Sample 🐞:
import puppeteer from "puppeteer";

// Try changing this! 👇
const URL = "https://t.me/s/ProgrammingTip";

const main = async () => {
const browser = await puppeteer.connect({
browserWSEndpoint: wss://chrome.browserless.io,
});
const page = await browser.newPage();
await page.goto(URL);

return page.screenshot();
}


[ GitHub ] : https://github.com/browserless/browserless
[ Website ] : https://www.browserless.io

〰️〰️〰️〰️〰️〰️
#E2E #Testing #Browserless #Docker
@ProgrammingTip
import puppeteer from "puppeteer";

// Try changing this! 👇
const URL = "https://t.me/s/ProgrammingTip";

const main = async () => {
const browser = await puppeteer.connect({
browserWSEndpoint: wss://chrome.browserless.io,
});
const page = await browser.newPage();
await page.goto(URL);

return page.screenshot();
}
import puppeteer from "puppeteer";
 
// Try changing this 👇
const URL = "https://t.me/s/ProgrammingTip";

const main = async () => {
  const browser = await puppeteer.connect({
    browserWSEndpoint: `wss://chrome.browserless.io`,
  });
  const page = await browser.newPage();
  await page.goto(URL);

  return page.screenshot();
}
Sample :
import puppeteer from "puppeteer";
 
// Try changing this 👇
const URL = "https://t.me/s/ProgrammingTip";

const main = async () => {
  const browser = await puppeteer.connect({
    browserWSEndpoint: wss://chrome.browserless.io,
  });
  const page = await browser.newPage();
  await page.goto(URL);

  return page.screenshot();
}
import puppeteer from "puppeteer";
 
// Try changing this 👇
const URL = "https://t.me/s/ProgrammingTip";

const main = async () => {
  const browser = await puppeteer.connect({
    browserWSEndpoint:
wss://chrome.browserless.io,
  });
  const page = await browser.newPage();
  await page.goto(URL);

  return page.screenshot();
}
import puppeteer from "puppeteer";
 
// Try changing this 👇
const URL = "https://t.me/s/ProgrammingTip";

const main = async () =>
  const browser = await puppeteer.connect({
    browserWSEndpoint: `wss://chrome.browserless.io`,
  });
  const page = await browser.newPage();
  await page.goto(URL);

  return page.screenshot();
import telegram
from prettytable import PrettyTable

def send_msg(text):
token = "*******:**************"
chat_id = "***********"
bot = telegram.Bot(token=token)

bot.sendMessage(chat_id=chat_id, text=text)

myTable = PrettyTable(["Student Name", "Class", "Section", "Percentage"])

myTable.add_row(["Leanord", "X", "B", "91.2 %"])
myTable.add_row(["Penny", "X", "C", "63.5 %"])
myTable.add_row(["Howard", "X", "A", "90.23 %"])
myTable.add_row(["Bernadette", "X", "D", "92.7 %"])
myTable.add_row(["Sheldon", "X", "A", "98.2 %"])
myTable.add_row(["Raj", "X", "B", "88.1 %"])
myTable.add_row(["Amy", "X", "B", "95.0 %"])
table_txt = myTable.get_string()
with open('output.txt','w') as file:
file.write(table_txt)
new_list = []
with open("output.txt", 'r', encoding="utf-8") as file:
send_msg(file.read())
import puppeteer from "puppeteer";
 
// Try changing this 👇
const URL = "https://t.me/s/ProgrammingTip";

const main = async () =>
  const browser = await puppeteer.connect({
    browserWSEndpoint: `wss://chrome.browserless.io`,
  });
  const page = await browser.newPage();
  await page.goto(URL);

  return page.screenshot();
`` import puppeteer from "puppeteer";
 
// Try changing this 👇
const URL = "https://t.me/s/ProgrammingTip";

const main = async () =>
  const browser = await puppeteer.connect({
    browserWSEndpoint: wss://chrome.browserless.io,
  });
  const page = await browser.newPage();
  await page.goto(URL);

  return page.screenshot();

``
"
  
// Try changing this 👇
const URL = "https://t.me/s/ProgrammingTip";

const main = async () =>
  const browser = await puppeteer.connect({
    browserWSEndpoint: `wss://chrome.browserless.io`,
  });
  const page = await browser.newPage();
  await page.goto(URL);

  return page.screenshot(); + "\n
"
"
  
// Try changing this 👇
const URL = "https://t.me/s/ProgrammingTip";

const main = async () =>
  const browser = await puppeteer.connect({
    browserWSEndpoint: `wss://chrome.browserless.io`,
  });
  const page = await browser.newPage();
  await page.goto(URL);

  return page.screenshot();
"
"`` import puppeteer from "puppeteer";
 
// Try changing this 👇
const URL = "https://t.me/s/ProgrammingTip";

const main = async () =>
  const browser = await puppeteer.connect({
    browserWSEndpoint:
wss://chrome.browserless.io,
  });
  const page = await browser.newPage();
  await page.goto(URL);

  return page.screenshot(); ``"
"import puppeteer from "puppeteer";
 
// Try changing this 👇
const URL = "https://t.me/s/ProgrammingTip";

const main = async () =>
  const browser = await puppeteer.connect({
    browserWSEndpoint:
wss://chrome.browserless.io,
  });
  const page = await browser.newPage();
  await page.goto(URL);

  return page.screenshot();
"
import telegram
from prettytable import PrettyTable

def send_msg(text):
token = "*******:**************"
chat_id = "***********"
bot = telegram.Bot(token=token)

bot.sendMessage(chat_id=chat_id, text=text)

myTable = PrettyTable(["Student Name", "Class", "Section", "Percentage"])

myTable.add_row(["Leanord", "X", "B", "91.2 %"])
myTable.add_row(["Penny", "X", "C", "63.5 %"])
myTable.add_row(["Howard", "X", "A", "90.23 %"])
myTable.add_row(["Bernadette", "X", "D", "92.7 %"])
myTable.add_row(["Sheldon", "X", "A", "98.2 %"])
myTable.add_row(["Raj", "X", "B", "88.1 %"])
myTable.add_row(["Amy", "X", "B", "95.0 %"])
table_txt = myTable.get_string()
with open('output.txt','w') as file:
file.write(table_txt)
new_list = []
with open("output.txt", 'r', encoding="utf-8") as file:
send_msg(file.read())