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")
NOTE: A newer version is been updated on the site ... visit here http://vastgk.blogspot.com/2017/07/download-code-blocks-1601-mingwsetup.html File Date Download from codeblocks-13.12-setup.exe 27 Dec 2013 BerliOS or Sourceforge.net codeblocks-13.12mingw-setup.exe 27 Dec 2013 BerliOS or Sourceforge.net codeblocks-13.12mingw-setup-TDM-GCC-481.exe 27 Dec 2013 BerliOS or Sourceforge.net NOTE : The codeblocks-13.12mingw-setup.exe file includes the GCC compiler and GDB debugger from TDM-GCC (version 4.7.1, 32 bit). The codeblocks-13.12mingw-setup-TDM-GCC-481.exe file includes the TDM-GCC compiler, version 4.8.1, 32 bit. While v4.7.1 is rock-solid (we use it to compile C::B), v4.8.1 is provided for convenience, there are some known bugs with this version related to the compilation of Code::Blocks itself. IF UNSURE, USE "codeblocks-13.12mingw-setup.exe"! \ Linux 32-bit: Dis...
Your Affiliate Money Printing Machine is ready -
ReplyDeleteAnd 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
If you're looking to lose kilograms then you certainly need to try this totally brand new personalized keto meal plan.
ReplyDeleteTo 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.