<jupyter_start><jupyter_text>1 - Find shortcodes of all posts based on hashtag without selenium* A shortcode represents a post * They are present in the sourcecode * Append them to a list and print 1.1-how to find shortcodes    1. Open instagram in the webbrowser    2. Search for the hashtag required (ex:bike,fashion,photography etc)    3. Find the source code of the hashtag or ctrl+u in browser (used google chrome)      * Search for shortcode by pressing ctrl+f in the source code.      * The amount will be approximately 75 that is the limit for browser.      * So, 75 is equivalent to 75 posts.            Simple scrape code to get short codes from given hastag link - Replace required hashtag in the place of bangalore - to get short codes  OUTPUT:<jupyter_code>#This code prints the shortcode from given source file
#Author:KT
#status:working
lines = [] 
 
#csv_file=open('shortcode.csv','w')  #remove all csv related comments to write o/p to file
import requests
lit=['bangalore']#hashtag

r=requests.get('https://www.instagram.com/explore/tags/'+lit[0])

import csv,re

matches=re.findall(r'\"(.+?)\"',str(r.text))
if "shortcode" in matches:
    indices = [i for i, x in enumerate(matches) if x == "shortcode"]#gets indices of all the shortcode word in file
for i in range(len(indices)):
    print(matches[indices[i]+1])
    #csv_file.write(matches[indices[i]+1]+'\n')
#csv_file.close()
print(len(indices))<jupyter_output>BuQ3_2ghgjA
BuQ3-jnHYvt
BuQ38U1FUpg
BuQ38JkFhqB
BuQ38JfFSG4
BuQ33kbA5AY
BuQ325xFFJy
BuQ32CsHk-P
BuQ3y2ZlcMI
BuQ3y2RlegX
BuQ3yJiHwuS
BuQ3vIXF-yI
BuQ3rOzAiFR
BuQ3FgdnZGo
BuQ3srfgsh7
BuQ3sIgFySc
BuQ3rMYAGr5
BuQ3o-2AWLu
BuQ3m5llgyK
BuQ3kvPA7c-
BuQ3kNODvmp
BuQ3jZzBdKN
BuQ3jS6lKTY
BuQ3jGKgJZ_
BuQ3iHChD8r
BuQ3gxfjAwx
BuQ3fOXA39n
BuQ3cvFAVX5
BuQ3cE8Akfy
BuQ3R7OgNpH
BuQ3bgBlsik
BuQ3bMWnAXo
BuQ3E2VAEW6
BuQ3ZuQH4zf
BuQ3ZG7nTMR
BuQ3Y8yAQhn
BuQ3XSrBoOX
BuQ3W5Pl7vS
BuQ3TsYHdtf
BuQ3SrXlaQn
BuQ3SpWnhGt
BuQ3SAaA3fR
BuQ3Q5oFf0V
BuQ3PMgAKIp
BuQ3OUagOt5
BuQ3N2QBic0
BuQ3No-hgYt
BuQ3NYgHp4N
BuQ3MAtFPiA
BuQ3LBbhFf9
BuQ3K8YlFSo
BuQ3H2QgUbP
BuQ3EmiAng4
BuQ3EMul03p
BuQ3DS2ALWK
BuQ3DTynLCo
BuQ3BTKgFLu
BuQ28oSAEBq
BuQ266YgLag
BuQ24WqgbOB
BuQ22p1A4cm
BuQ21R1A6tM
BuQ2zU2AvEQ
BuQ2vs0l_sc
BuQzj2SgnqF
BuQu-v9hu4e
BuQs6Avlfje
BuO2AVHHSmB
BuO1vEwHd7_
BuF_tnuB-bB
BuQ33kbA5AY
BuQpxLkgDld
BuQ1rukA1yL
BuQa4xzg9JY
BuQ1LxBBpVa
BuQyPVhBBaj
BuQzLAKFgPS
BuP6UOpg3T0
BuQzKbPnpOC
79
{'fraction_non_alphanumeric': 0.06462442299622324, 'fraction_numerical': 0.0658833403273185, 'mean_word_length': 5.677871148459384, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 1, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '100890', 'license': 'MIT', 'n_tokens_mistral': 1225, 'n_tokens_neox': 1151, 'n_words': 253, 'path': 'collecting_shortcodes_git.ipynb', 'repo_name': 'krishnakaspe/scrapemaster', 'size': '2383'}