Categories
Python

Selenium Firefox Webdriver Python Setup

Python Code

from bs4 import BeautifulSoup
import requests
import pandas as pd
import numpy as np
import csv
import re
from selenium import webdriver


#driver = webdriver.Firefox(capabilities={"marionette":False})
caps = webdriver.DesiredCapabilities.FIREFOX
caps["marionette"] = False
driver = webdriver.Firefox(capabilities=caps)


driver.get("https://www.google.com")

print (driver.title)

Python Code with Headless Firefox

from bs4 import BeautifulSoup
import requests
import pandas as pd
import numpy as np
import csv
import re
from selenium import webdriver
from selenium.webdriver.firefox.options import Options
options = Options()
options.add_argument("--headless")


#driver = webdriver.Firefox(capabilities={"marionette":False})
caps = webdriver.DesiredCapabilities.FIREFOX
caps["marionette"] = False
driver = webdriver.Firefox(capabilities=caps, firefox_options=options)


driver.get("https://www.google.com")

print (driver.title)

WebDriverException: Message: Can’t load the profile

Try,

caps["marionette"] = True

Get all Divs using Selenium Driver Python

X Path

divs = driver.find_elements_by_xpath('//li/div')

CSS Selector

divs = driver.find_elements_by_css_selector('li > div')

What is Anadrol
danger of steroids
best hgh
testosterone injection price
Categories
Web Server

Nginx

Check syntax of Nginx’s configuration files

nginx -t -c /etc/nginx/nginx.conf

Debug Command

$ service nginx configtest

Apache Server Port number Check

netstat -ntpl |grep httpd
Categories
Coding

JavaScript get child Element

Getting inner Div

var mainDiv = document.getElementById('mainDiv'),
childDiv = mainDiv.getElementsByTagName('div')[0],
requiredDiv = childDiv.getElementsByTagName('div')[1];
Categories
Uncategorized WordPress WordPress Development

is_front_page() && is_home() WordPress Default, Static and Blog Page

if ( is_front_page() && is_home() ) {
 // Default homepage

} elseif ( is_front_page()){
 //Static homepage

} elseif ( is_home()){

//Blog page

} else {

//everything else

}

Categories
WordPress WordPress Development

gulpfile.js Example SASS CSS

Example of gulpfile.js compiling SASS to CSS