kandi background
Explore Kits

roma | ROMA: A Distributed KeyValue Store in Ruby | Key Value Database library

 by   roma Ruby Version: v1.3.0 License: GPL-3.0

 by   roma Ruby Version: v1.3.0 License: GPL-3.0

Download this library from

kandi X-RAY | roma Summary

roma is a Ruby library typically used in Database, Key Value Database applications. roma has no bugs, it has no vulnerabilities, it has a Strong Copyleft License and it has low support. You can download it from GitHub.
ROMA is one of the data storing systems for distributed key-value stores. It is a completely decentralized distributed system that consists of multiple processes, called nodes, on several machines. It is based on pure P2P architecture like a distributed hash table, thus it provides high availability and scalability. ROMA is written in Ruby. However, following choices are available to access to ROMA.
Support
Support
Quality
Quality
Security
Security
License
License
Reuse
Reuse

kandi-support Support

  • roma has a low active ecosystem.
  • It has 320 star(s) with 39 fork(s). There are 24 watchers for this library.
  • It had no major release in the last 12 months.
  • There are 18 open issues and 36 have been closed. On average issues are closed in 23 days. There are 3 open pull requests and 0 closed requests.
  • It has a neutral sentiment in the developer community.
  • The latest version of roma is v1.3.0
roma Support
Best in #Key Value Database
Average in #Key Value Database
roma Support
Best in #Key Value Database
Average in #Key Value Database

quality kandi Quality

  • roma has 0 bugs and 0 code smells.
roma Quality
Best in #Key Value Database
Average in #Key Value Database
roma Quality
Best in #Key Value Database
Average in #Key Value Database

securitySecurity

  • roma has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
  • roma code analysis shows 0 unresolved vulnerabilities.
  • There are 0 security hotspots that need review.
roma Security
Best in #Key Value Database
Average in #Key Value Database
roma Security
Best in #Key Value Database
Average in #Key Value Database

license License

  • roma is licensed under the GPL-3.0 License. This license is Strong Copyleft.
  • Strong Copyleft licenses enforce sharing, and you can use them when creating open source projects.
roma License
Best in #Key Value Database
Average in #Key Value Database
roma License
Best in #Key Value Database
Average in #Key Value Database

buildReuse

  • roma releases are available to install and integrate.
  • Installation instructions, examples and code snippets are available.
  • It has 16418 lines of code, 1193 functions and 108 files.
  • It has high code complexity. Code complexity directly impacts maintainability of the code.
roma Reuse
Best in #Key Value Database
Average in #Key Value Database
roma Reuse
Best in #Key Value Database
Average in #Key Value Database
Top functions reviewed by kandi - BETA

kandi has reviewed roma and discovered the below as its top functions. This is intended to give you an instant insight into roma implemented functionality, and help decide if they suit your requirements.

  • Initialize a new instance
  • Retrieves data from a file
  • Transforms the config data
  • Initializes the table
  • Synchronizes the node to the VN node .
  • Initializes a new account
  • Calculates the latency for the command
  • start event loop
  • initialize
  • Synchronizes a VR node to the VN .

roma Key Features

Client libraries of Ruby and Java are available.

ROMA protocol is compatible with memcached text-based one so that any memcached client libraries allows users to interact with ROMA.

Install ROMA

copy iconCopydownload iconDownload
$ gem install roma

Make routing files

copy iconCopydownload iconDownload
$ mkroute localhost_10001 localhost_10002 --replication_in_host

Start up ROMA

copy iconCopydownload iconDownload
$ romad localhost -p 10001 -d --replication_in_host
$ romad localhost -p 10002 -d --replication_in_host

Usage

copy iconCopydownload iconDownload
$ telnet localhost 10001

Google search with Selenium Python doesn't work

copy iconCopydownload iconDownload
driver.execute_script('return document.querySelector("#L2AGLb > div")').click()
names = ['Ristorante Roma Antica', 'Ristorante e Braceria Al Piave']

for name in names:
    input_search = wait.until(EC.visibility_of_element_located((By.XPATH, "//input[@name='q']")))
    input_search.clear()
    input_search.send_keys(name + Keys.ENTER)

    phone = wait.until(EC.visibility_of_element_located((By.XPATH, "//span[contains(@aria-label,'Call phone number')]"))).text
    print(phone)
    driver.execute_script("window.history.go(-1)")

    time.sleep(0.5)
-----------------------
driver.execute_script('return document.querySelector("#L2AGLb > div")').click()
names = ['Ristorante Roma Antica', 'Ristorante e Braceria Al Piave']

for name in names:
    input_search = wait.until(EC.visibility_of_element_located((By.XPATH, "//input[@name='q']")))
    input_search.clear()
    input_search.send_keys(name + Keys.ENTER)

    phone = wait.until(EC.visibility_of_element_located((By.XPATH, "//span[contains(@aria-label,'Call phone number')]"))).text
    print(phone)
    driver.execute_script("window.history.go(-1)")

    time.sleep(0.5)
-----------------------
//a[text()='Phone']/../following-sibling::span/descendant::span[@aria-label]
names = ['Ristorante Roma Antica Roma', 'Ristorante e Braceria Al Piave Roma']

for name in names:
    input_search = wait.until(EC.visibility_of_element_located((By.NAME, 'q')))
    input_search.clear()
    input_search.send_keys(name, Keys.RETURN)

    time.sleep(0.5)

    #wait.until(EC.visibility_of_element_located((By.CLASS_NAME, 'gNO89b'))).click()

    #time.sleep(0.5)

    # Extract the phone number here
    try:
        phone_number = wait.until(EC.visibility_of_element_located((By.XPATH, "//a[text()='Phone']/../following-sibling::span/descendant::span[@aria-label]")))
        print(phone_number.text)
    except:
        pass

    driver.execute_script("window.history.go(-1)")
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
+39 06 7047 6283
+39 06 484467

Process finished with exit code 0
-----------------------
//a[text()='Phone']/../following-sibling::span/descendant::span[@aria-label]
names = ['Ristorante Roma Antica Roma', 'Ristorante e Braceria Al Piave Roma']

for name in names:
    input_search = wait.until(EC.visibility_of_element_located((By.NAME, 'q')))
    input_search.clear()
    input_search.send_keys(name, Keys.RETURN)

    time.sleep(0.5)

    #wait.until(EC.visibility_of_element_located((By.CLASS_NAME, 'gNO89b'))).click()

    #time.sleep(0.5)

    # Extract the phone number here
    try:
        phone_number = wait.until(EC.visibility_of_element_located((By.XPATH, "//a[text()='Phone']/../following-sibling::span/descendant::span[@aria-label]")))
        print(phone_number.text)
    except:
        pass

    driver.execute_script("window.history.go(-1)")
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
+39 06 7047 6283
+39 06 484467

Process finished with exit code 0
-----------------------
//a[text()='Phone']/../following-sibling::span/descendant::span[@aria-label]
names = ['Ristorante Roma Antica Roma', 'Ristorante e Braceria Al Piave Roma']

for name in names:
    input_search = wait.until(EC.visibility_of_element_located((By.NAME, 'q')))
    input_search.clear()
    input_search.send_keys(name, Keys.RETURN)

    time.sleep(0.5)

    #wait.until(EC.visibility_of_element_located((By.CLASS_NAME, 'gNO89b'))).click()

    #time.sleep(0.5)

    # Extract the phone number here
    try:
        phone_number = wait.until(EC.visibility_of_element_located((By.XPATH, "//a[text()='Phone']/../following-sibling::span/descendant::span[@aria-label]")))
        print(phone_number.text)
    except:
        pass

    driver.execute_script("window.history.go(-1)")
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
+39 06 7047 6283
+39 06 484467

Process finished with exit code 0
-----------------------
//a[text()='Phone']/../following-sibling::span/descendant::span[@aria-label]
names = ['Ristorante Roma Antica Roma', 'Ristorante e Braceria Al Piave Roma']

for name in names:
    input_search = wait.until(EC.visibility_of_element_located((By.NAME, 'q')))
    input_search.clear()
    input_search.send_keys(name, Keys.RETURN)

    time.sleep(0.5)

    #wait.until(EC.visibility_of_element_located((By.CLASS_NAME, 'gNO89b'))).click()

    #time.sleep(0.5)

    # Extract the phone number here
    try:
        phone_number = wait.until(EC.visibility_of_element_located((By.XPATH, "//a[text()='Phone']/../following-sibling::span/descendant::span[@aria-label]")))
        print(phone_number.text)
    except:
        pass

    driver.execute_script("window.history.go(-1)")
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
+39 06 7047 6283
+39 06 484467

Process finished with exit code 0

Selenium Get all child element text but skip some child element text under certain condition

copy iconCopydownload iconDownload
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
import time


chrome_options = Options()
chrome_options.add_argument("--headless")


driver = webdriver.Chrome(executable_path="./chromedriver", options=chrome_options)
driver.get("https://www.mojidict.com/details/198951091?notationMode=1")

time.sleep(5)

total_text_element = driver.find_element_by_xpath("(//div[@class='example-info'])[8]")
total_text = total_text_element.text

undesired_text_element = driver.find_element_by_xpath("(//div[@class='example-info'])[8]/div/ruby/rt")
undesired_text = undesired_text_element.text

desired_text = total_text.replace(undesired_text, "")
desired_text = desired_text.replace("\n\n", "")
print(desired_text)

Office-Scripts: Add Client-Analysts combinations entered as exceptions in a column into another Table

copy iconCopydownload iconDownload
function main(workbook: ExcelScript.Workbook) {
  // simple array of the mapping table used for testing purposes 
  let exceptionsValues = [
    ["Nico Vera", "Maple", "Globus Ltd~Walter Lobo * Kevin Kline~Sarah Wick * Monsanto Ltd~Ana Wier"],
    ["Vijay Malya", "Sonny", ""],
    ["Sam Tucker", "Parvati", "Mars~Sonapuri * China Blue~Mona Dsa"],
    ["Pessy Shroff", "Roy", "Harbinger Ltd~Jose Silva * Theos Ltd~Jay Mills"]
  ];
  
  // augment the original mappings array by creating a new row for each exception (split on the "*") and deleting the row with the concatenated exceptions
  exceptionsValues.map((curRow, index) => {
    if (curRow[2].indexOf("*") > 0) {
      let tempRows = curRow[2].split(" * ");
      for (let row of tempRows) {
        exceptionsValues.push([curRow[0], curRow[1], row])
      }
      delete exceptionsValues[index]
    };
  });

  // next as a proof of concept I filtered on values you are values in the study report
  let filteredExceptions = exceptionsValues.filter(row => row[0] == "Nico Vera" &&  row[2].indexOf("Kevin") >= 0);

  // from here you might make find the indexOf the "~" character and split the string to extract the Assigned Analysts name. At this point you already have a row for each exception so it should be relatively easy to extract

  // the proof of concept would need to be run as you create each row in your study report table.

  // a few console statements to see results
  console.log(exceptionsValues);
  console.log(filteredExceptions);
}

Tricky MySQL view

copy iconCopydownload iconDownload
CREATE VIEW stats AS
  SELECT season, team
       , sum(TGS) TGS, sum(TGC) TGC, sum(pts) pts
       , RANK() OVER (PARTITION BY season ORDER BY SUM(pts) DESC) AS rnk
    FROM (
           SELECT season, HomeTeam team, FTHG TGS, FTAG TGC
                , CASE WHEN FTHG > FTAG THEN 3 WHEN FTHG = FTAG THEN 1 ELSE 0 END pts
             FROM game
            UNION ALL
           SELECT season, AwayTeam team, FTAG TGS, FTHG TGC
                , CASE WHEN FTAG > FTHG THEN 3 WHEN FTAG = FTHG THEN 1 ELSE 0 END pts
             FROM game
         ) games
   GROUP BY season, team
;

JSON by Jackson: hide field name but keep the value

copy iconCopydownload iconDownload
@Data
@NoArgsConstructor
public class CoupleInfo {

    public List<String> list = new ArrayList<>();

    public CoupleInfo(String place, String address){
        list.add(place);
        list.add(address);
    }

    @JsonValue
    public List<String> getList() {
        return list;
    }
}
{"name":"giulio","surname":"marri","addresses":[["roma","piazza liberta"],["torino","via torre"]]}
-----------------------
@Data
@NoArgsConstructor
public class CoupleInfo {

    public List<String> list = new ArrayList<>();

    public CoupleInfo(String place, String address){
        list.add(place);
        list.add(address);
    }

    @JsonValue
    public List<String> getList() {
        return list;
    }
}
{"name":"giulio","surname":"marri","addresses":[["roma","piazza liberta"],["torino","via torre"]]}

Select item value with radio buttons

copy iconCopydownload iconDownload
function cittaBox() {

    var selezione = document.getElementById("selector");
    var selezioneTxt = selezione.options[selezione.selectedIndex].text;
    document.getElementById("txtBox").value=selezioneTxt;
}
-----------------------
function cittaBox() {
  console.log(1)
    var selezione = document.getElementById("selector");
    var selezioneTxt = selezione.options[selezione.selectedIndex].text;
    document.getElementById("txtBox").value=selezioneTxt;
}
<SELECT NAME="citta" id="selector" onchange="cittaBox()">
                  <OPTION value="Roma">   Roma   </OPTION>
                  <OPTION value="Milano">   Milano   </OPTION>
                  <OPTION value="Torino">   Torino </OPTION>
                  <OPTION value="Napoli">   Napoli  </OPTION>
                  <OPTION value="Bari">   Bari    </OPTION>
                  <OPTION value="Taranto">   Taranto    </OPTION>
                  <OPTION value="Lecce">   Lecce    </OPTION>
               </SELECT>
               </P>
               <P align= "center" id="selezione0">
                  <INPUT type="text" name="citta" size="40" id="txtBox">
                </P>  
-----------------------
function cittaBox() {
  console.log(1)
    var selezione = document.getElementById("selector");
    var selezioneTxt = selezione.options[selezione.selectedIndex].text;
    document.getElementById("txtBox").value=selezioneTxt;
}
<SELECT NAME="citta" id="selector" onchange="cittaBox()">
                  <OPTION value="Roma">   Roma   </OPTION>
                  <OPTION value="Milano">   Milano   </OPTION>
                  <OPTION value="Torino">   Torino </OPTION>
                  <OPTION value="Napoli">   Napoli  </OPTION>
                  <OPTION value="Bari">   Bari    </OPTION>
                  <OPTION value="Taranto">   Taranto    </OPTION>
                  <OPTION value="Lecce">   Lecce    </OPTION>
               </SELECT>
               </P>
               <P align= "center" id="selezione0">
                  <INPUT type="text" name="citta" size="40" id="txtBox">
                </P>  

Unable to scrape images under tab

copy iconCopydownload iconDownload
import requests
from bs4 import BeautifulSoup
import re


imageLinks = {}
url = 'https://www.novitecgroup.com/en/brands/ferrari/roma/tuningpart/1536'

response = requests.get(url)
soup = BeautifulSoup(response.text, 'html.parser')

for each in ['transparent', 'solid']:
    imageLinks[each] = []
    rims = soup.find('div', {'class':re.compile(f"^rims__{each}")})
    images = rims.find_all('img')
    
    for img in images:
        imageLinks[each].append(img['src'])
print(imageLinks)
{'transparent': ['/vossen-felgen/cap.jpg', '/vossen-felgen/angled/1-Midnight-Smoke-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1002-400x400.jpg', '/vossen-felgen/head-on/1-Midnight-Smoke-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1001-400x400.jpg', '/vossen-felgen/angled/2-Dark-Smoke-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1002-400x400.jpg', '/vossen-felgen/head-on/2-Dark-Smoke-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1001-400x400.jpg', '/vossen-felgen/angled/3--Light-Smoke-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1002-400x400.jpg', '/vossen-felgen/head-on/3--Light-Smoke-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1001-400x400.jpg', '/vossen-felgen/angled/4-Gloss-Clear-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1002-400x400.jpg', '/vossen-felgen/head-on/4-Gloss-Clear-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1001-400x400.jpg', '/vossen-felgen/angled/5-Stealth-Grey-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1002-400x400.jpg', '/vossen-felgen/head-on/5-Stealth-Grey-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1001-400x400.jpg', '/vossen-felgen/angled/7-Space-Grey-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1002-400x400.jpg', '/vossen-felgen/head-on/7-Space-Grey-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1001-400x400.jpg', '/vossen-felgen/angled/6-Platinum-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1002-400x400.jpg', '/vossen-felgen/head-on/6-Platinum-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1001-400x400.jpg', '/vossen-felgen/angled/8-Matte-Clear-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1002-400x400.jpg', '/vossen-felgen/head-on/8-Matte-Clear-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1001-400x400.jpg', '/vossen-felgen/angled/9-Patina-Gold-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1002-400x400.jpg', '/vossen-felgen/head-on/9-Patina-Gold-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1001-400x400.jpg', '/vossen-felgen/angled/10-Honeycomb-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1002-400x400.jpg', '/vossen-felgen/head-on/10-Honeycomb-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1001-400x400.jpg', '/vossen-felgen/angled/11-Champagne-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1002-400x400.jpg', '/vossen-felgen/head-on/11-Champagne-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1001-400x400.jpg', '/vossen-felgen/angled/12-Vintage-Ros-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1002-400x400.jpg', '/vossen-felgen/head-on/12-Vintage-Ros-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1001-400x400.jpg', '/vossen-felgen/angled/13-Amber-Tone-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1002-400x400.jpg', '/vossen-felgen/head-on/13-Amber-Tone-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1001-400x400.jpg', '/vossen-felgen/angled/14-Copper-Penny-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1002-400x400.jpg', '/vossen-felgen/head-on/14-Copper-Penny-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1001-400x400.jpg', '/vossen-felgen/angled/15-Bronze-Brickell-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1002-400x400.jpg', '/vossen-felgen/head-on/15-Bronze-Brickell-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1001-400x400.jpg', '/vossen-felgen/angled/16-Imperial-Gold-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1002-400x400.jpg', '/vossen-felgen/head-on/16-Imperial-Gold-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1001-400x400.jpg', '/vossen-felgen/angled/17-Merlot-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1002-400x400.jpg', '/vossen-felgen/head-on/17-Merlot-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1001-400x400.jpg', '/vossen-felgen/angled/18-Vossen-Red-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1002-400x400.jpg', '/vossen-felgen/head-on/18-Vossen-Red-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1001-400x400.jpg', '/vossen-felgen/angled/19-Scarlet-Red-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1002-400x400.jpg', '/vossen-felgen/head-on/19-Scarlet-Red-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1001-400x400.jpg', '/vossen-felgen/angled/20-Flamingo-Pink-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1002-400x400.jpg', '/vossen-felgen/head-on/20-Flamingo-Pink-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1001-400x400.jpg', '/vossen-felgen/angled/21-Deco-Teal-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1002-400x400.jpg', '/vossen-felgen/head-on/21-Deco-Teal-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1001-400x400.jpg', '/vossen-felgen/angled/22-Fountain-Blue-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1002-400x400.jpg', '/vossen-felgen/head-on/22-Fountain-Blue-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1001-400x400.jpg', '/vossen-felgen/angled/23-Biscayne-Blue-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1002-400x400.jpg', '/vossen-felgen/head-on/23-Biscayne-Blue-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1001-400x400.jpg', '/vossen-felgen/angled/24-Limelight-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1002-400x400.jpg', '/vossen-felgen/head-on/24-Limelight-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1001-400x400.jpg'], 'solid': ['/vossen-felgen/angled/25-Gloss-Black-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1002-400x400.jpg', '/vossen-felgen/head-on/25-Gloss-Black-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1001-400x400.jpg', '/vossen-felgen/angled/26-Satin-Black-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1002-400x400.jpg', '/vossen-felgen/head-on/26-Satin-Black-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1001-400x400.jpg', '/vossen-felgen/angled/27-Matte-Black-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1002-400x400.jpg', '/vossen-felgen/head-on/27-Matte-Black-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1001-400x400.jpg', '/vossen-felgen/angled/28-Textured-Black-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1002-400x400.jpg', '/vossen-felgen/head-on/28-Textured-Black-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1001-400x400.jpg', '/vossen-felgen/angled/29-Gloss-Charcoal-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1002-400x400.jpg', '/vossen-felgen/head-on/29-Gloss-Charcoal-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1001-400x400.jpg', '/vossen-felgen/angled/30-Gloss-Gunmetal-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1002-400x400.jpg', '/vossen-felgen/head-on/30-Gloss-Gunmetal-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1001-400x400.jpg', '/vossen-felgen/angled/31-Matte-Gunmetal-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1002-400x400.jpg', '/vossen-felgen/head-on/31-Matte-Gunmetal-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1001-400x400.jpg', '/vossen-felgen/angled/32-Textured-Gunmetal-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1002-400x400.jpg', '/vossen-felgen/head-on/32-Textured-Gunmetal-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1001-400x400.jpg', '/vossen-felgen/angled/33-Gloss-Silver-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1002-400x400.jpg', '/vossen-felgen/head-on/33-Gloss-Silver-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1001-400x400.jpg', '/vossen-felgen/angled/34-Satin-Silver-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1002-400x400.jpg', '/vossen-felgen/head-on/34-Satin-Silver-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1001-400x400.jpg', '/vossen-felgen/angled/35-Pewter-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1002-400x400.jpg', '/vossen-felgen/head-on/35-Pewter-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1001-400x400.jpg', '/vossen-felgen/angled/36-Ballteship-Grey-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1002-400x400.jpg', '/vossen-felgen/head-on/36-Ballteship-Grey-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1001-400x400.jpg', '/vossen-felgen/angled/37-Espresso-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1002-400x400.jpg', '/vossen-felgen/head-on/37-Espresso-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1001-400x400.jpg', '/vossen-felgen/angled/38-Gloss-Bronze-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1002-400x400.jpg', '/vossen-felgen/head-on/38-Gloss-Bronze-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1001-400x400.jpg', '/vossen-felgen/angled/39-Satin-Bronze-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1002-400x400.jpg', '/vossen-felgen/head-on/39-Satin-Bronze-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1001-400x400.jpg', '/vossen-felgen/angled/40-Textured-Bronze-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1002-400x400.jpg', '/vossen-felgen/head-on/40-Textured-Bronze-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1001-400x400.jpg', '/vossen-felgen/angled/41-Butterscotch-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1002-400x400.jpg', '/vossen-felgen/head-on/41-Butterscotch-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1001-400x400.jpg', '/vossen-felgen/angled/42-Heritage-Gold-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1002-400x400.jpg', '/vossen-felgen/head-on/42-Heritage-Gold-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1001-400x400.jpg', '/vossen-felgen/angled/43-Gloss-Gold-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1002-400x400.jpg', '/vossen-felgen/head-on/43-Gloss-Gold-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1001-400x400.jpg', '/vossen-felgen/angled/44-Satin-Gold-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1002-400x400.jpg', '/vossen-felgen/head-on/44-Satin-Gold-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1001-400x400.jpg', '/vossen-felgen/angled/45-Denim-Blue-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1002-400x400.jpg', '/vossen-felgen/head-on/45-Denim-Blue-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1001-400x400.jpg', '/vossen-felgen/angled/46-Ultraviolet-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1002-400x400.jpg', '/vossen-felgen/head-on/46-Ultraviolet-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1001-400x400.jpg', '/vossen-felgen/angled/47-Fire-Red-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1002-400x400.jpg', '/vossen-felgen/head-on/47-Fire-Red-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1001-400x400.jpg', '/vossen-felgen/angled/48-Miami-White-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1002-400x400.jpg', '/vossen-felgen/head-on/48-Miami-White-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1001-400x400.jpg']}
-----------------------
import requests
from bs4 import BeautifulSoup
import re


imageLinks = {}
url = 'https://www.novitecgroup.com/en/brands/ferrari/roma/tuningpart/1536'

response = requests.get(url)
soup = BeautifulSoup(response.text, 'html.parser')

for each in ['transparent', 'solid']:
    imageLinks[each] = []
    rims = soup.find('div', {'class':re.compile(f"^rims__{each}")})
    images = rims.find_all('img')
    
    for img in images:
        imageLinks[each].append(img['src'])
print(imageLinks)
{'transparent': ['/vossen-felgen/cap.jpg', '/vossen-felgen/angled/1-Midnight-Smoke-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1002-400x400.jpg', '/vossen-felgen/head-on/1-Midnight-Smoke-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1001-400x400.jpg', '/vossen-felgen/angled/2-Dark-Smoke-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1002-400x400.jpg', '/vossen-felgen/head-on/2-Dark-Smoke-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1001-400x400.jpg', '/vossen-felgen/angled/3--Light-Smoke-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1002-400x400.jpg', '/vossen-felgen/head-on/3--Light-Smoke-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1001-400x400.jpg', '/vossen-felgen/angled/4-Gloss-Clear-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1002-400x400.jpg', '/vossen-felgen/head-on/4-Gloss-Clear-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1001-400x400.jpg', '/vossen-felgen/angled/5-Stealth-Grey-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1002-400x400.jpg', '/vossen-felgen/head-on/5-Stealth-Grey-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1001-400x400.jpg', '/vossen-felgen/angled/7-Space-Grey-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1002-400x400.jpg', '/vossen-felgen/head-on/7-Space-Grey-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1001-400x400.jpg', '/vossen-felgen/angled/6-Platinum-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1002-400x400.jpg', '/vossen-felgen/head-on/6-Platinum-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1001-400x400.jpg', '/vossen-felgen/angled/8-Matte-Clear-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1002-400x400.jpg', '/vossen-felgen/head-on/8-Matte-Clear-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1001-400x400.jpg', '/vossen-felgen/angled/9-Patina-Gold-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1002-400x400.jpg', '/vossen-felgen/head-on/9-Patina-Gold-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1001-400x400.jpg', '/vossen-felgen/angled/10-Honeycomb-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1002-400x400.jpg', '/vossen-felgen/head-on/10-Honeycomb-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1001-400x400.jpg', '/vossen-felgen/angled/11-Champagne-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1002-400x400.jpg', '/vossen-felgen/head-on/11-Champagne-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1001-400x400.jpg', '/vossen-felgen/angled/12-Vintage-Ros-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1002-400x400.jpg', '/vossen-felgen/head-on/12-Vintage-Ros-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1001-400x400.jpg', '/vossen-felgen/angled/13-Amber-Tone-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1002-400x400.jpg', '/vossen-felgen/head-on/13-Amber-Tone-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1001-400x400.jpg', '/vossen-felgen/angled/14-Copper-Penny-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1002-400x400.jpg', '/vossen-felgen/head-on/14-Copper-Penny-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1001-400x400.jpg', '/vossen-felgen/angled/15-Bronze-Brickell-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1002-400x400.jpg', '/vossen-felgen/head-on/15-Bronze-Brickell-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1001-400x400.jpg', '/vossen-felgen/angled/16-Imperial-Gold-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1002-400x400.jpg', '/vossen-felgen/head-on/16-Imperial-Gold-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1001-400x400.jpg', '/vossen-felgen/angled/17-Merlot-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1002-400x400.jpg', '/vossen-felgen/head-on/17-Merlot-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1001-400x400.jpg', '/vossen-felgen/angled/18-Vossen-Red-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1002-400x400.jpg', '/vossen-felgen/head-on/18-Vossen-Red-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1001-400x400.jpg', '/vossen-felgen/angled/19-Scarlet-Red-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1002-400x400.jpg', '/vossen-felgen/head-on/19-Scarlet-Red-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1001-400x400.jpg', '/vossen-felgen/angled/20-Flamingo-Pink-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1002-400x400.jpg', '/vossen-felgen/head-on/20-Flamingo-Pink-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1001-400x400.jpg', '/vossen-felgen/angled/21-Deco-Teal-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1002-400x400.jpg', '/vossen-felgen/head-on/21-Deco-Teal-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1001-400x400.jpg', '/vossen-felgen/angled/22-Fountain-Blue-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1002-400x400.jpg', '/vossen-felgen/head-on/22-Fountain-Blue-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1001-400x400.jpg', '/vossen-felgen/angled/23-Biscayne-Blue-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1002-400x400.jpg', '/vossen-felgen/head-on/23-Biscayne-Blue-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1001-400x400.jpg', '/vossen-felgen/angled/24-Limelight-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1002-400x400.jpg', '/vossen-felgen/head-on/24-Limelight-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1001-400x400.jpg'], 'solid': ['/vossen-felgen/angled/25-Gloss-Black-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1002-400x400.jpg', '/vossen-felgen/head-on/25-Gloss-Black-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1001-400x400.jpg', '/vossen-felgen/angled/26-Satin-Black-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1002-400x400.jpg', '/vossen-felgen/head-on/26-Satin-Black-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1001-400x400.jpg', '/vossen-felgen/angled/27-Matte-Black-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1002-400x400.jpg', '/vossen-felgen/head-on/27-Matte-Black-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1001-400x400.jpg', '/vossen-felgen/angled/28-Textured-Black-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1002-400x400.jpg', '/vossen-felgen/head-on/28-Textured-Black-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1001-400x400.jpg', '/vossen-felgen/angled/29-Gloss-Charcoal-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1002-400x400.jpg', '/vossen-felgen/head-on/29-Gloss-Charcoal-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1001-400x400.jpg', '/vossen-felgen/angled/30-Gloss-Gunmetal-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1002-400x400.jpg', '/vossen-felgen/head-on/30-Gloss-Gunmetal-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1001-400x400.jpg', '/vossen-felgen/angled/31-Matte-Gunmetal-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1002-400x400.jpg', '/vossen-felgen/head-on/31-Matte-Gunmetal-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1001-400x400.jpg', '/vossen-felgen/angled/32-Textured-Gunmetal-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1002-400x400.jpg', '/vossen-felgen/head-on/32-Textured-Gunmetal-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1001-400x400.jpg', '/vossen-felgen/angled/33-Gloss-Silver-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1002-400x400.jpg', '/vossen-felgen/head-on/33-Gloss-Silver-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1001-400x400.jpg', '/vossen-felgen/angled/34-Satin-Silver-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1002-400x400.jpg', '/vossen-felgen/head-on/34-Satin-Silver-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1001-400x400.jpg', '/vossen-felgen/angled/35-Pewter-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1002-400x400.jpg', '/vossen-felgen/head-on/35-Pewter-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1001-400x400.jpg', '/vossen-felgen/angled/36-Ballteship-Grey-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1002-400x400.jpg', '/vossen-felgen/head-on/36-Ballteship-Grey-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1001-400x400.jpg', '/vossen-felgen/angled/37-Espresso-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1002-400x400.jpg', '/vossen-felgen/head-on/37-Espresso-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1001-400x400.jpg', '/vossen-felgen/angled/38-Gloss-Bronze-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1002-400x400.jpg', '/vossen-felgen/head-on/38-Gloss-Bronze-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1001-400x400.jpg', '/vossen-felgen/angled/39-Satin-Bronze-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1002-400x400.jpg', '/vossen-felgen/head-on/39-Satin-Bronze-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1001-400x400.jpg', '/vossen-felgen/angled/40-Textured-Bronze-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1002-400x400.jpg', '/vossen-felgen/head-on/40-Textured-Bronze-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1001-400x400.jpg', '/vossen-felgen/angled/41-Butterscotch-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1002-400x400.jpg', '/vossen-felgen/head-on/41-Butterscotch-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1001-400x400.jpg', '/vossen-felgen/angled/42-Heritage-Gold-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1002-400x400.jpg', '/vossen-felgen/head-on/42-Heritage-Gold-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1001-400x400.jpg', '/vossen-felgen/angled/43-Gloss-Gold-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1002-400x400.jpg', '/vossen-felgen/head-on/43-Gloss-Gold-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1001-400x400.jpg', '/vossen-felgen/angled/44-Satin-Gold-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1002-400x400.jpg', '/vossen-felgen/head-on/44-Satin-Gold-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1001-400x400.jpg', '/vossen-felgen/angled/45-Denim-Blue-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1002-400x400.jpg', '/vossen-felgen/head-on/45-Denim-Blue-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1001-400x400.jpg', '/vossen-felgen/angled/46-Ultraviolet-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1002-400x400.jpg', '/vossen-felgen/head-on/46-Ultraviolet-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1001-400x400.jpg', '/vossen-felgen/angled/47-Fire-Red-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1002-400x400.jpg', '/vossen-felgen/head-on/47-Fire-Red-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1001-400x400.jpg', '/vossen-felgen/angled/48-Miami-White-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1002-400x400.jpg', '/vossen-felgen/head-on/48-Miami-White-Vossen-Forged-Finishing-Options--Vossen-Wheels-2015-1001-400x400.jpg']}

Data resolution adjustment

copy iconCopydownload iconDownload
library(ggplot2)
library(lubridate)

# df <- structure(...) # omitted for brevity

ggplot(df, aes(x=Time, y=Price, group= interaction(Band, day(Date)))) + 
  geom_line(aes(color=Band), lwd=1)+
  labs(x="Time (hours)", y="Price", title="")+
  theme_bw() +
  theme(axis.text.x = element_text(angle = 90, hjust = 1)) +  
  scale_y_continuous(expand = c(0,0))

Kivi - How to change text of label based on variable taken from mysql

copy iconCopydownload iconDownload
def build(self):
        self.sm = sm = ScreenManager()
        self.wid1 = wid1 = prono1(name='prono1')
        self.wid2 = wid2 = prono2(name='prono2')
        sm.add_widget(wid1)
        sm.add_widget(wid2)
        sm.ids['wid1']= wid1
        sm.ids['wid2']= wid2
        return sm
        MDLabel:
            id: labl1   ## <------ Here you set the id
            size_hint_y: None
            size_hint_x: 1
            height: self.texture_size[1]
            text_size: self.width, None
            font_size: 20
            padding: 10, 20
            color: 0,0,0,1
            text: 'bla bla bla' #### <------------ name of the match that I want to display (WITH ID = 2 - so Roma - inter)
            halign: 'center'
App.get_running_app().sm.ids['wid1'].ids.labll
def get_match(self, id_partita):
        query = "SELECT partita FROM db.partite where id_partita = VALUES (%s)"
        values = (id_partita)
        c.execute(query, values)
        partita = c.fetchone() ## <---- In this variable I have the label that I want to display
        App.get_running_app().sm.ids['wid1'].ids.labll.text = 'Text has changed'
        return print(partita)
-----------------------
def build(self):
        self.sm = sm = ScreenManager()
        self.wid1 = wid1 = prono1(name='prono1')
        self.wid2 = wid2 = prono2(name='prono2')
        sm.add_widget(wid1)
        sm.add_widget(wid2)
        sm.ids['wid1']= wid1
        sm.ids['wid2']= wid2
        return sm
        MDLabel:
            id: labl1   ## <------ Here you set the id
            size_hint_y: None
            size_hint_x: 1
            height: self.texture_size[1]
            text_size: self.width, None
            font_size: 20
            padding: 10, 20
            color: 0,0,0,1
            text: 'bla bla bla' #### <------------ name of the match that I want to display (WITH ID = 2 - so Roma - inter)
            halign: 'center'
App.get_running_app().sm.ids['wid1'].ids.labll
def get_match(self, id_partita):
        query = "SELECT partita FROM db.partite where id_partita = VALUES (%s)"
        values = (id_partita)
        c.execute(query, values)
        partita = c.fetchone() ## <---- In this variable I have the label that I want to display
        App.get_running_app().sm.ids['wid1'].ids.labll.text = 'Text has changed'
        return print(partita)
-----------------------
def build(self):
        self.sm = sm = ScreenManager()
        self.wid1 = wid1 = prono1(name='prono1')
        self.wid2 = wid2 = prono2(name='prono2')
        sm.add_widget(wid1)
        sm.add_widget(wid2)
        sm.ids['wid1']= wid1
        sm.ids['wid2']= wid2
        return sm
        MDLabel:
            id: labl1   ## <------ Here you set the id
            size_hint_y: None
            size_hint_x: 1
            height: self.texture_size[1]
            text_size: self.width, None
            font_size: 20
            padding: 10, 20
            color: 0,0,0,1
            text: 'bla bla bla' #### <------------ name of the match that I want to display (WITH ID = 2 - so Roma - inter)
            halign: 'center'
App.get_running_app().sm.ids['wid1'].ids.labll
def get_match(self, id_partita):
        query = "SELECT partita FROM db.partite where id_partita = VALUES (%s)"
        values = (id_partita)
        c.execute(query, values)
        partita = c.fetchone() ## <---- In this variable I have the label that I want to display
        App.get_running_app().sm.ids['wid1'].ids.labll.text = 'Text has changed'
        return print(partita)
-----------------------
def build(self):
        self.sm = sm = ScreenManager()
        self.wid1 = wid1 = prono1(name='prono1')
        self.wid2 = wid2 = prono2(name='prono2')
        sm.add_widget(wid1)
        sm.add_widget(wid2)
        sm.ids['wid1']= wid1
        sm.ids['wid2']= wid2
        return sm
        MDLabel:
            id: labl1   ## <------ Here you set the id
            size_hint_y: None
            size_hint_x: 1
            height: self.texture_size[1]
            text_size: self.width, None
            font_size: 20
            padding: 10, 20
            color: 0,0,0,1
            text: 'bla bla bla' #### <------------ name of the match that I want to display (WITH ID = 2 - so Roma - inter)
            halign: 'center'
App.get_running_app().sm.ids['wid1'].ids.labll
def get_match(self, id_partita):
        query = "SELECT partita FROM db.partite where id_partita = VALUES (%s)"
        values = (id_partita)
        c.execute(query, values)
        partita = c.fetchone() ## <---- In this variable I have the label that I want to display
        App.get_running_app().sm.ids['wid1'].ids.labll.text = 'Text has changed'
        return print(partita)

Averages per time-intervals

copy iconCopydownload iconDownload
library(dplyr)
# Get times in seconds
four_thirty_am  <- 4.5 * 60 * 60
four_pm  <- 16 * 60 * 60
eight_pm  <- 20 * 60 * 60

df$timePeriod  <- ifelse(
    df$Time <= four_thirty_am, 
    "00:00-04:30", 
    ifelse(
        df$Time >= four_pm & df$Time <= eight_pm, 
        "16:00-20:00", 
        "Other")
    )

df  %>% 
    group_by(timePeriod)  %>% 
    summarise(meanPrice = mean(Price))
# A tibble: 3 x 2      
  timePeriod  meanPrice
* <chr>           <dbl>
1 00:00-04:30      2.42
2 16:00-20:00     20.7 
3 Other           11.4
-----------------------
library(dplyr)
# Get times in seconds
four_thirty_am  <- 4.5 * 60 * 60
four_pm  <- 16 * 60 * 60
eight_pm  <- 20 * 60 * 60

df$timePeriod  <- ifelse(
    df$Time <= four_thirty_am, 
    "00:00-04:30", 
    ifelse(
        df$Time >= four_pm & df$Time <= eight_pm, 
        "16:00-20:00", 
        "Other")
    )

df  %>% 
    group_by(timePeriod)  %>% 
    summarise(meanPrice = mean(Price))
# A tibble: 3 x 2      
  timePeriod  meanPrice
* <chr>           <dbl>
1 00:00-04:30      2.42
2 16:00-20:00     20.7 
3 Other           11.4
-----------------------


library(dplyr)
library(lubridate)
library(hms)

df_new<-df %>%
  mutate(time=Time %>% as_hms()) %>%
  mutate(period=case_when(
    time >=("00:30:00" %>% as_hms()) & time <=("04:30:00" %>% as_hms())  ~ "00:30-04:30", 
    time >=("16:00:00" %>% as_hms()) & time <=("20:00:00" %>% as_hms())  ~ "16:00-20:00",   
    TRUE ~ "other"
  )) %>%
  group_by(period)  %>%
 summarise(meanPrice = mean(Price))

df_new
#> # A tibble: 3 × 2
#>   period      meanPrice
#>   <chr>           <dbl>
#> 1 00:30-04:30      2.26
#> 2 16:00-20:00     20.7 
#> 3 other           11.1
-----------------------
library(tidyverse)
library(lubridate)
df %>%
  mutate(period = period_to_seconds(as.period(Time)),
         time_group = case_when(period >= 1*30*60 & period <= 9*30*60 ~ "00:30 - 04:30",
                                period >= 32*30*60 & period <= 40*30*60 ~ "16:00 - 20:00",
                                TRUE ~ "other")) %>%
  group_by(time_group) %>%
  summarize(mean_price = mean(Price))
# A tibble: 3 x 2
  time_group    mean_price
  <chr>              <dbl>
1 00:30 - 04:30       2.26
2 16:00 - 20:00      20.7 
3 other              11.1 
-----------------------
library(tidyverse)
library(lubridate)
df %>%
  mutate(period = period_to_seconds(as.period(Time)),
         time_group = case_when(period >= 1*30*60 & period <= 9*30*60 ~ "00:30 - 04:30",
                                period >= 32*30*60 & period <= 40*30*60 ~ "16:00 - 20:00",
                                TRUE ~ "other")) %>%
  group_by(time_group) %>%
  summarize(mean_price = mean(Price))
# A tibble: 3 x 2
  time_group    mean_price
  <chr>              <dbl>
1 00:30 - 04:30       2.26
2 16:00 - 20:00      20.7 
3 other              11.1 

Community Discussions

Trending Discussions on roma
  • Google search with Selenium Python doesn't work
  • Selenium Get all child element text but skip some child element text under certain condition
  • Office-Scripts: Add Client-Analysts combinations entered as exceptions in a column into another Table
  • Tricky MySQL view
  • JSON by Jackson: hide field name but keep the value
  • Select item value with radio buttons
  • Unable to scrape images under tab
  • Data resolution adjustment
  • Kivi - How to change text of label based on variable taken from mysql
  • Averages per time-intervals
Trending Discussions on roma

QUESTION

Google search with Selenium Python doesn't work

Asked 2022-Mar-22 at 17:25

I would like to retrieve the phone number of some points of interest from the Google results page with Selenium Python. I can accept the terms of use of Google but I can neither enter the query nor press the button. This is my code:

rom selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
import time

url = 'https://www.google.it/'

driver = webdriver.Chrome()
wait = WebDriverWait(driver, 20)
driver.get(url)

time.sleep(0.5)

# Accept the Google terms of use
driver.execute_script('return document.querySelector("#L2AGLb > div")').click()

names = ['Ristorante Roma Antica Roma', 'Ristorante e Braceria Al Piave Roma']

for name in names:
    input_search = wait.until(EC.visibility_of_element_located((By.CLASS_NAME, 'gLFyf gsfi')))
    input_search.clear()
    input_search.send_keys(name)

    time.sleep(0.5)

    wait.until(EC.visibility_of_element_located((By.CLASS_NAME, 'gNO89b'))).click()

    time.sleep(0.5)

    # Extract the phone number here
    try:
        phone_number = ...
    except:
        pass

    driver.execute_script("window.history.go(-1)")

I should extract the phone number from the panel on the right of the page after clicking the button "Search" (if the panel is available).

Thanks in advance for your suggestions.

ADDENDUM

To find the phone numbers: inspecting the pages I have to search within the following span tags ('LrzXr zdqRlf kno-fv' is unique):

<span class="LrzXr zdqRlf kno-fv"><a data-dtype="d3ph" data-local-attribute="d3ph" jscontroller="LWZElb" href="#" jsdata="QKGTRc;_;B2Cx5o" jsaction="rcuQ6b:npT2md;F75qrd" data-ved="2ahUKEwik7rXAlNr2AhUFgP0HHedMA-IQkAgoAHoECDcQAw"><span><span aria-label="Chiama il numero di telefono 06 7047 6283">06 7047 6283</span></span></a></span>

and

<span class="LrzXr zdqRlf kno-fv"><a data-dtype="d3ph" data-local-attribute="d3ph" jscontroller="LWZElb" href="#" jsdata="QKGTRc;_;B4wf3Y" jsaction="rcuQ6b:npT2md;F75qrd" data-ved="2ahUKEwiwzs3blNr2AhU477sIHe5TA3sQkAgoAHoECEgQAw"><span><span aria-label="Chiama il numero di telefono 06 484467">06 484467</span></span></a></span>

My goal is to retrieve '06 7047 6283' and '06 484467'.

I succeeded using regular expressions but I would like to avoid them if possible:

content = wait.until(EC.visibility_of_element_located((By.XPATH, '//*[@id="kp-wp-tab-overview"]'))).text
phone_number = re.findall(r'Telefono: ([0-9 ]+)', content)[0]

ANSWER

Answered 2022-Mar-22 at 17:25

I'm not sure what is this line here for:

driver.execute_script('return document.querySelector("#L2AGLb > div")').click()

I can't see any element matching that locator there and it throws an exception for me.
Also I have fixed the locator of search input field and the way to click Enter there so my code is:

names = ['Ristorante Roma Antica', 'Ristorante e Braceria Al Piave']

for name in names:
    input_search = wait.until(EC.visibility_of_element_located((By.XPATH, "//input[@name='q']")))
    input_search.clear()
    input_search.send_keys(name + Keys.ENTER)

    phone = wait.until(EC.visibility_of_element_located((By.XPATH, "//span[contains(@aria-label,'Call phone number')]"))).text
    print(phone)
    driver.execute_script("window.history.go(-1)")

    time.sleep(0.5)

And it works.
At lest it opens the search results.

Source https://stackoverflow.com/questions/71574931

Community Discussions, Code Snippets contain sources that include Stack Exchange Network

Vulnerabilities

No vulnerabilities reported

Install roma

You can simply install ROMA and dependency libralies by using a gem command of Ruby as follows.

Support

Refer to ROMA documentations

DOWNLOAD this Library from

Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from
over 430 million Knowledge Items
Find more libraries
Reuse Solution Kits and Libraries Curated by Popular Use Cases

Save this library and start creating your kit

Explore Related Topics

Share this Page

share link
Reuse Pre-built Kits with roma
Consider Popular Key Value Database Libraries
Compare Key Value Database Libraries with Highest Support
Compare Key Value Database Libraries with Highest Quality
Compare Key Value Database Libraries with Highest Security
Compare Key Value Database Libraries with Permissive License
Compare Key Value Database Libraries with Highest Reuse
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from
over 430 million Knowledge Items
Find more libraries
Reuse Solution Kits and Libraries Curated by Popular Use Cases

Save this library and start creating your kit

  • © 2022 Open Weaver Inc.