Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const Copperfield = require("copperfield_ceic");
- var copperfield = new Copperfield({
- viewport: {
- width: 1920,
- height: 1080,
- isMobile: false
- },
- puppeteer: {
- timeout: 15 * 60 * 1000
- }
- });
- const username = 'proxy@emis.com';
- const password = 'zaq1%40WSX!QAZ';
- var files1 = {
- "table1.html": {
- "radioXPath": ".//input[@id='radioExp']",
- "valueXPath": ".//input[@id='radioRs']"
- }
- }
- var siteUrl = "https://commerce-app.gov.in/ftpa/rgncntq.asp";
- var submitButtnXPath = ".//input[@id='button1']";
- copperfield
- .headless(false)
- .retry(10)
- .die(true)
- .blacklist(['.css', '.png', '.gif', '.jpeg', 'google-analytics', 'yandex'])
- .clientScripts([])
- //.proxy("in.c1168256407.saasprotection.com:8080")
- .steps(async function (parameters) {
- // await this.page.authenticate({username, password});
- await this.open(siteUrl, 30*1000, 'domcontentloaded');
- console.log("navigated")
- await this.simWaitAndClick(parameters.radioXPath, 5000, 'load', false);
- await this.simWaitAndClick(parameters.valueXPath, 5000, 'load', false);
- console.log("clicked on radio")
- await this.waitAndClick(".//input[contains(@type, 'submit')]", 5000, 'load', false);
- console.log("clicked on submit")
- // await this.evaluate(function(){
- // $("#busqueda > div.seleccion > div.tipo_informacion > div.select > select").val(1);
- // $("#busqueda > div.seleccion > div.tipo_informacion > div.select > select").change();
- // })
- await this.wait(3000);
- // await this.evaluate(function(){
- // $("#busqueda > div.seleccion > div.medida > div.select > select").val("[Measures].[ESTIMACION TRIM]");
- // $("#busqueda > div.seleccion > div.medida > div.select > select").change();
- // })
- // await this.wait(3000);
- // await this.evaluate(function(){
- // $("#O").click();
- // })
- // await this.wait(3000);
- // await this.evaluate(function(){
- // document.querySelectorAll("#AY")[1].click()
- // })
- // await this.wait(5000);
- // await this.waitAndClick(normalize("//a[contains(@title, 'Generar resultados')]"), 5000, 'load', false);
- // await this.wait(5000);
- // await this.evaluate(function(){
- // console.log("HERE!")
- // $("#btn_exportar").click();
- // })
- await this.wait(1000);
- })
- .run(files1);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement