Open in app

Sign In

Write

Sign In

Teddy Zugana
Teddy Zugana

61 Followers

Home

About

Oct 14, 2022

Python Scraping web page with BeautifulSoup and requests Example

from bs4 import BeautifulSoup import requests url = "https://www.point2homes.com/MX/Real-Estate-Listings.html?LocationGeoId=&LocationGeoAreaId=&Location=San%20Felipe,%20Baja%20California,%20Mexico" headers = {"User-Agent": "Mozilla/5.0","Content-Type": "application/json"} page_scrape = requests.get(url, headers=headers) soup = BeautifulSoup(page_scrape.content, 'html.parser') lists = soup.find_all('article') for list in lists: address = list.find('div', class_="address-container").text try: beds = list.find('li', class_="ic-beds").text except: print("Data Not Logged") try: baths = list.find('li', class_="ic-baths").text except: print("Data not logged") try: size = list.find('li', class_="ic-sqft").text except: print("Data not logged") type = list.find('li', class_="property-type ic-proptype").text price = list.find('span', class_="green").text agent = list.find('div', class_="agent-name").text firmstr = list.find('div', class_="agent-company") firm='' if firmstr is not None: spl_word = '>' firmstr2=str(firmstr) res = firmstr2.split(spl_word, 1) splitString = res[1] res2 = splitString.split('<', 1) splitString2 = res2[0] firm=splitString2 info = [address, beds, baths, size, type, price, agent, firm] print(info);

Pyhton

1 min read

Pyhton

1 min read


Oct 14, 2022

PHP Mimic Excel Rate Function

<?php define('FINANCIAL_MAX_ITERATIONS', 128); define('FINANCIAL_PRECISION', 1.0e-08); function RATE($nper, $pmt, $pv, $fv = 0.0, $type = 0, $guess = 0.1) { $rate = $guess; if (abs($rate) < FINANCIAL_PRECISION) {…

PHP

1 min read

PHP

1 min read


Jun 15, 2022

Tomcat java.lang.OutOfMemoryError: PermGen space

Steps to increase PermGen Heap Space in Tomcat: 1) Go to Tomcat installation directory i.e C:\Program Files\Apache Software Foundation\Apache Tomcat 7.0.14\bin in Windows and something similar in Linux. 2) Add JAVA_OPTS in your catalina.bat or Catalina.sh In Windows: set JAVA_OPTS=”-Xms1024m -Xmx10246m -XX:NewSize=256m -XX:MaxNewSize=356m -XX:PermSize=256m -XX:MaxPermSize=356m” In linux: export JAVA_OPTS=”-Xms1024m -Xmx10246m -XX:NewSize=256m -XX:MaxNewSize=356m -XX:PermSize=256m -XX:MaxPermSize=356m”

Java

1 min read

Tomcat java.lang.OutOfMemoryError: PermGen space
Tomcat java.lang.OutOfMemoryError: PermGen space
Java

1 min read


Jun 6, 2022

How To Install unixODBC-devel on CentOS 7 and Connect DB2 V9.7

Introduction In this tutorial we learn how to install unixODBC-devel on CentOS 7. What is unixODBC-devel The unixODBC package can be used to access databases through ODBC drivers. If you want to develop programs that will access data through ODBC, you need to install this package. The unixODBC package can be used to access…

Linux

3 min read

How To Install unixODBC-devel on CentOS 7 and Connect DB2 V9.7
How To Install unixODBC-devel on CentOS 7 and Connect DB2 V9.7
Linux

3 min read


Sep 20, 2021

How to configure SVN Server on CentOS/RHEL 5/6/7

Subversion is a version and revision control framework utilized by engineers to track and keep up prior version of their source codes. Subversion oversees file and directory, and the changes made to them, over time.This …

Centos

3 min read

Subversion is a version and revision control framework utilized by engineers to track and keep up…
Subversion is a version and revision control framework utilized by engineers to track and keep up…
Centos

3 min read


Sep 20, 2021

Install Latest Git ( Git 2.x ) on CentOS

This guide is for installing the latest release of Git on CentOS 7 server. The git version available on CentOS 7 repository is a bit old, 1.x. If you need a newer version of Git, then use this guide to install it. Git is a distributed version control system used…

Git

2 min read

Git

2 min read


Sep 20, 2021

How to Install and Secure MariaDB 10 in CentOS 6

In a previous tutorial, we have showed you how to install MariaDB 10 in CentOS 7. In this guide, we will show you how to install and secure MariaDB 10.1 stable version in RHEL/CentOS 6 distributions. Note that in this tutorial, we’ll assume your working on the server as root…

Centos

2 min read

How to Install and Secure MariaDB 10 in CentOS 6
How to Install and Secure MariaDB 10 in CentOS 6
Centos

2 min read


Aug 19, 2021

Java, Common substring of two string in JAVA

public String getLongestCommonSubstring(String str1, String str2) { int m = str1.length(); int n = str2.length(); int max = 0; int[][] dp = new int[m][n]; int endIndex=-1; for(int i=0; i<m; i++){ for(int j=0; j<n; j++){ if(str1.charAt(i) == str2.charAt(j)){ // If first row or column if(i==0 || j==0){ dp[i][j]=1; }else{ // Add 1 to the diagonal value dp[i][j] = dp[i-1][j-1]+1; } if(max < dp[i][j]) { max = dp[i][j]; endIndex=i; } } } } // We want String upto endIndex, we are using endIndex+1 in substring. return str1.substring(endIndex-max+1,endIndex+1); } }

Java

1 min read

Java

1 min read


Jul 29, 2021

PHP Recursive Fibonacci

#php <?php $inputdata = @$_POST[‘inputdata’]; if(empty($inputdata)) { $inputdata = @$_GET[‘inputdata’]; } $result = array(); if(is_numeric($inputdata)) { if(!empty($inputdata)) { $result = array(); for ($i = 0; $i < $inputdata; $i++) { $dataseriestemp=series($i); if($dataseriestemp==0) { } else if($dataseriestemp%2==1) { $result[]=$dataseriestemp; } } }

PHP

1 min read

PHP

1 min read


Jul 29, 2021

PHP Damarau levenstein on Longest Match SubString

#php function getLongestMatchingSubstring($str1, $str2) { $len_1 = strlen($str1); $longest = ‘’; for($i = 0; $i < $len_1; $i++) { for($j = $len_1 — $i; $j > 0; $j — ) { $sub = substr($str1, $i, $j); if (strpos($str2, $sub) !== false && strlen($sub) > strlen($longest)) { $longest = $sub; break; } } } return $longest; }

PHP

1 min read

PHP

1 min read

Teddy Zugana

Teddy Zugana

61 Followers

aku, selagi hidup telah menaklukan semesta

Following
  • Spores Network

    Spores Network

  • Tiny World

    Tiny World

  • Otaku Coin

    Otaku Coin

  • Hillstone Finance

    Hillstone Finance

  • For Metas Official

    For Metas Official

See all (230)

Help

Status

Writers

Blog

Careers

Privacy

Terms

About

Text to speech