Skip to main content

python program to Print Starting Series OF Indian Mobile Number for a State or operator or both

import requests
import urllib.request
import time
from bs4 import BeautifulSoup as bs
import re
url =' https://en.wikipedia.org/wiki/Mobile_telephone_numbering_in_India'
state_to_extract="UE" #if set to None all state is considered
telecom_to_extracted=None #if set to none all operator from particular city is extracted


response = requests.get(url)
print(response)
soup = bs(response.text,"html.parser")
one_a_tag = soup.findAll('tr')[35:]
lst=[]

for k in one_a_tag:
 s=k.findAll('td')
 limit=len(s)
 i=0
 while True:
  if i==limit:
   break
  
  no=s[i].text
  i+=1
  if i==limit:
   break
  operator=s[i].text
  i+=1
  if i==limit:
   break
  state=s[i].text
  i+=1
  if i==limit:
   break
  res=f"{no} {operator} {state}"
  if state_to_extract is  None :
   if telecom_to_extracted is None:
    lst.append(no)
   elif telecom_to_extracted in res:
     lst.append(no)
   else:
    print("please specify either state or operator or both")
    input()
    break
  elif state_to_extract in res:
   if telecom_to_extracted is None:
    lst.append(no)
   elif telecom_to_extracted in res :
     lst.append(no) #inteded operator of intended state found
   else:
    pass
    #currently not the intended operator

  else:
   pass
   #currently not the desired State...

  print(res)

  print("-"*20)
print(lst)
stateName="india" if state_to_extract==None else state_to_extract
opName="all_operator" if telecom_to_extracted==None else telecom_to_extracted
filename=f"{stateName}__{opName}.txt"
with open(filename,"w") as f:
 for z in lst:

  print(f"writing {z} to file")
  f.write(z)
  f.write("\n")



 

Comments

  1. Your Affiliate Money Printing Machine is ready -

    And getting it running is as simple as 1---2---3!

    Here is how it all works...

    STEP 1. Tell the system what affiliate products the system will promote
    STEP 2. Add PUSH button traffic (it ONLY takes 2 minutes)
    STEP 3. Watch the system explode your list and upsell your affiliate products all for you!

    Are you ready to start making money??

    Click here to activate the system

    ReplyDelete
  2. If you're looking to lose kilograms then you certainly need to try this totally brand new personalized keto meal plan.

    To create this service, licensed nutritionists, personal trainers, and chefs joined together to produce keto meal plans that are useful, decent, money-efficient, and fun.

    Since their grand opening in early 2019, thousands of individuals have already remodeled their body and well-being with the benefits a certified keto meal plan can offer.

    Speaking of benefits: in this link, you'll discover eight scientifically-certified ones offered by the keto meal plan.

    ReplyDelete

Post a Comment

share your thoughts ....

Popular posts from this blog

Track Lost Android Phone and Tablet

1. Use the IMEI Number Every Android phone carries a unique IMEI number. It will be printed at the back of your device. If you are unable to find the number, you have to launch your phone app and dial the number *#06#. This will give you the IMEI number of your phone. Store this number in a safe place so that it helps you in locating your phone when it is lost 2 Android Device Manager Google has recently released a new locator feature for Android gadgets called Android Device Manager, which helps its users locate their lost or stolen phones and tablets. It functions in the same way as Lookout and Samsung’s “Find My Mobile”. Here’s how to use Android Device Manager. Go to the Google Settings app, then select Android device manager. By default, the locator feature is activated but to activate remote data wipe, select the box next to “Allow remote factory reset”, then select “activate”. To use this feature, open the site https://www.google.com/android/devicemanager and sig...

13 websites to register your free domain

Register your Free Domain Now!! 1)  .tk Dot TK is a FREE domain registry for websites on the Internet. It has exactly the same power as other domain extensions, but it’s free! Because it’s free, millions of others have been using .TK domains since 2001 – which makes .TK powerful and very recognizable.  Your website will be like www.yourdomainname.tk . It is free for 1 year. It’s a ccTLD domain whixh having the abbreviation  Tokelau. To create a .tk domain, Visit   www.dot.tk 2) co.cc Co.cc is completely free domain which is mostly used by blogspot bloggers because of it’s easy to use DNS system. Creating a co.cc for blogger is simple ( for instructions- “click here”). Your website will be like www.yourdomainname.co.cc . To create a .co.cc domain, visit www.co.cc 3)   co.nr co.nr is too like co.cc. Your website will be like  www.yourdomainname.co.nr . You can add it for blogger also.. To create a .co.cc domain, vi...

Bypass Online Surveys to Download a File

Pop Up windows by Fileice or Sharecash If you have Seen this Type of window before Downloading any file then you are welcome to give a read to this article.You will know that why you should not  download this  file or if you really want to download it without performing any real  online survey  then How to do it.Also see :  How to Make Money with PPD sites Without any Blog Note : I don’t Download anything From any PPD(Pay per Download) sites as most of the Downloads does not work and there are many More Other methods to get a File from Internet (Eg. Torrent ).So First thing I’ll Suggest you that Do not download anything from Fileice.net and Sharecash.org as they are not worthy of your countless seconds. So If you are not satisfied by my above mentioned Statement then I have some Tips/Tricks for you by which you can Bypass  Online Surveys  for Downloading a File.It is whether Fileice or Sharecash.I have found these trick and Tips on Go...

Download Complete Websites For Offline Access

there  are the various tool available on the internet to download a complete site .. with the following tool you can download a complete site or a particular section of a site: 1.Internet Download manager : In the internet download manager, you can use Site Grabber option to download a site. this is what I mostly use ..some other alternatives are. Getleft Getleft   has a new, modern feel to its interface. Upon launch, press   “Ctrl + U”   to quickly get started by entering an URL and save directory. Before the download begins, you’ll be asked which files should be downloaded. We are using Google as our example, so these pages should look familiar. Every page that’s included in the download will be extracted, which means every file from those particular pages will be downloaded. Once begun, all files will be pulled to the local system like so: DOWNLOAD GETLEFT PageNest DOWNLOAD PAGENEST Cyotek WebCopy ...

8 Tools to Track Registry and File Changes by installing a software

1.  Regshot unicode Regshot is a long running utility that can quickly take a before and after snapshot of the system registry. Also in the more recent unicode version it’s gained the ability to monitor for file changes using CRC32 and MD5 file checksums although this function is turned off by default and you have to go to File -> Options -> Common Options -> and tick “Check files in the specified folders” to enable it. Only the Windows folder is entered into the list of watched folders so you have to enter any others yourself through the Folders tab. This version also added the Connect to remote registry option. Regshot is very much a “hands on” utility and is more for experienced or advanced users to quickly check for system changes between two different points in time. Simply create the 1st shot, install the software or run the program you want to watch, and then press 2nd shot. After comparing the differences in the 1st and 2nd shots, it will open an HTML log ...

Dragon Age: Inquisition Digital Deluxe Edition + All DLCs (torrent) Repack Size: 20.1~23.9 GB

Brief : Dragon Age: Inquisition  is an  action role-playing video game  developed by  Bioware Edmonton  and published by  Electronic Arts . The third major game in the  Dragon Age  franchise,  Dragon Age: Inquisition  is the sequel to  Dragon Age: Origins  and  Dragon Age II . The game was released worldwide in November 2014 for  Microsoft Windows ,  PlayStation 3 ,  PlayStation 4 ,  Xbox 360 , and  Xbox One . Repack Size: 20.1~23.9 GB 

DOWNLOAD CODE BLOCKS 16.01 MINGW.SETUP .EXE 86.3 MB

Code::Blocks for Mac is a free C, C++ and Fortran IDE that has a custom build system and optional Make support. The application has been designed to be very extensible and fully configurable. Code::Blocks is an IDE packed full of all the features you will need. It has a consistent look, feel and operation across its supported platforms. It has been built around a plugin framework, therefore Code::Blocks can be extended with plugins. Support for any kind of functionality can be added by installing/coding a plugin. Key features include: Written in C++. No interpreted languages or proprietary libs needed.. Full plugin support. Multiple compiler support: GCC (MingW / GNU GCC), MSVC++, clang, Digital Mars, Borland C++ 5.5, and Open Watcom etc. Support for parallel builds. Imports Dev-C++ projects. Debugger with full breakpoints support. Cross-platform. Code::Blocks' interface is both customizable and extensible with Syntax highlighting, a tabbed interface, Class Br...

Google Sheet/Google form Script to send automated Email to users

Well many of us want to send especially bloggers sometimes want to send automated replies to user 's ..but as usual, not everyone is a code geek or lovers ... so this is a small guide to How to use Google form with Google sheet to make an automated reply link....so follow the steps accordingly. STEP 1: GOTO google Forms ... and create a form ... in my case I just take users email id and how do they get to my site. 1. GOTO   https://docs.google.com/forms?usp=mkt_forms 2. login with your account. now choose blank form. 3. in Form title write your forms name, for example, let say my form. 4. in Form description write the description let say  A simple form ... 5. now go to setting and in general tab, check collect email address. and  click on save 6. (optional) you can also ask some basic question 7. now goto responses tab now click on create new spreadsheet button. (that green icon ..) in select response, destination cho...

Java Program to print integers you have input through console using BufferedReader and StringTokenizer

import java.util.*; import java.io.*;   class Buf_R_Str_Token{      public static void main(String args[]) throws IOException{          BufferedReader b_r = new BufferedReader( new InputStreamReader(System.in));          String str = b_r.readLine();                     StringTokenizer st = new StringTokenizer(str, "," );                     String item;          try {              while ((item = st.nextToken()) != null ){                  System.out.print( " " + item);      ...