Skip to content

Instantly share code, notes, and snippets.

@erajanraja24
erajanraja24 / gist:2c51e76f906c49f341f331920111aca3
Created December 16, 2018 11:35
Scrape Google search results -Title, URL by Location
function scrapeGoogle() {
var searchResults=UrlFetchApp.fetch("https://www.google.co.uk/search?q="+encodeURIComponent("keyword finder tool")+"&num=30",{muteHttpExceptions:true});
var titleExp=/<h3 class=\"r\">([\s\S]*?)<\/h3>/gi;
var urlExpression=/<h3 class=\"r\">([\s\S]*?)\&amp\;/gi;
var titleResults=searchResults.getContentText().match(titleExp);
function scrapeGoogle() {
var searchResults=UrlFetchApp.fetch("https://www.google.co.in/search?q="+encodeURIComponent("amarindaz youtube channel"));
var titleExp=/<h3 class=\"r\">([\s\S]*?)<\/h3>/gi;
var titleResults=searchResults.getContentText().match(titleExp);
// Logger.log(titleResults);
for(var i in titleResults)
@erajanraja24
erajanraja24 / Navigation commands in selenium webdriver
Created November 1, 2017 06:46
Navigation commands in selenium webdriver
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
public class Ex1 {
public static void main(String[] args) throws InterruptedException {
System.setProperty("webdriver.chrome.driver", "chromedriver.exe");
WebDriver driver=new ChromeDriver();
driver.get("https://www.google.co.in");
import java.util.List;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
public class Ex1 {
public static void main(String[] args) throws InterruptedException {
@erajanraja24
erajanraja24 / Locators in Selenium Webdriver
Created October 1, 2017 12:36
Locators in Selenium Webdriver
import java.util.List;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
public class Ex1 {
public static void main(String[] args) throws InterruptedException {
@erajanraja24
erajanraja24 / Java selenium Eclipse Installation and Set up
Created September 29, 2017 13:06
Java selenium Eclipse Installation and Set up-Selenium Webdriver with Java Tutorials for QA Professionals- Part 2
package com.ex1.Module1;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
public class Ex1 {
public static void main(String[] args) {
System.setProperty("webdriver.chrome.driver", "chromedriver.exe");
WebDriver driver=new ChromeDriver();
@erajanraja24
erajanraja24 / Read Excel
Created September 26, 2017 11:58
Read Excel File
public static HashMap<Integer,HashMap<Integer,String>> getUsername() throws IOException
{
int lrow,lcol;
FileInputStream fs=new FileInputStream(new File("Upload_Sequence.xlsx"));
XSSFWorkbook wb=new XSSFWorkbook(fs);
XSSFSheet sh0=wb.getSheet("Sheet1");
lrow=sh0.getLastRowNum();
System.out.println("Last row "+lrow);
@erajanraja24
erajanraja24 / Read Excel
Created September 26, 2017 11:58
Read Excel File
public static HashMap<Integer,HashMap<Integer,String>> getUsername() throws IOException
{
int lrow,lcol;
FileInputStream fs=new FileInputStream(new File("Upload_Sequence.xlsx"));
XSSFWorkbook wb=new XSSFWorkbook(fs);
XSSFSheet sh0=wb.getSheet("Sheet1");
lrow=sh0.getLastRowNum();
System.out.println("Last row "+lrow);
@erajanraja24
erajanraja24 / Read Excel
Created September 26, 2017 11:58
Read Excel File
public static HashMap<Integer,HashMap<Integer,String>> getUsername() throws IOException
{
int lrow,lcol;
FileInputStream fs=new FileInputStream(new File("Upload_Sequence.xlsx"));
XSSFWorkbook wb=new XSSFWorkbook(fs);
XSSFSheet sh0=wb.getSheet("Sheet1");
lrow=sh0.getLastRowNum();
System.out.println("Last row "+lrow);
@erajanraja24
erajanraja24 / CO 99 script
Last active September 4, 2017 14:25
C099
package com.test.on;
import java.io.IOException;
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import come.ExcelReadWrite.ExcelRead;
public class Co99 extends Wrapper{