New Web scrap Proj
This commit is contained in:
		
						commit
						1ed36563e3
					
				
							
								
								
									
										12
									
								
								PyGame/practice/webscrap2.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								PyGame/practice/webscrap2.py
									
									
									
									
									
										Normal file
									
								
							| 
						 | 
					@ -0,0 +1,12 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import requests  
 | 
				
			||||||
 | 
					from bs4 import BeautifulSoup  
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					def getdata(url):  
 | 
				
			||||||
 | 
					    r = requests.get(url)  
 | 
				
			||||||
 | 
					    return r.text  
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					htmldata = getdata("https://cs.finescale.com/fsm/m/online/1581353.aspx")  
 | 
				
			||||||
 | 
					soup = BeautifulSoup(htmldata, 'html.parser')  
 | 
				
			||||||
 | 
					for item in soup.find_all('img'): 
 | 
				
			||||||
 | 
					    print(item['src'])
 | 
				
			||||||
							
								
								
									
										6
									
								
								PyGame/practice/webscrape.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								PyGame/practice/webscrape.py
									
									
									
									
									
										Normal file
									
								
							| 
						 | 
					@ -0,0 +1,6 @@
 | 
				
			||||||
 | 
					import requests
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					URL = "https://cs.finescale.com/fsm/m/online/1581353.aspx"
 | 
				
			||||||
 | 
					page = requests.get(URL)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					print(page.text)
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user