Sep-29-2021, 05:39 PM
The site use JavaScript when click on link to generate source link to image.
Could use Selenium for this,and other way is to look as source code to see what's going on.
Can give a quick demo as this may be not a so easy if new to this.
In source download
Then do new call with new url that take id as parameter.
Could use Selenium for this,and other way is to look as source code to see what's going on.
Can give a quick demo as this may be not a so easy if new to this.
In source download
soup
are all id's in a JavaScript array,can use regex to grab all id's.Then do new call with new url that take id as parameter.
import requests from bs4 import BeautifulSoup import re url = 'http://g2w.ubi.com/farcry2/?page=1' response = requests.get(url) soup = BeautifulSoup(response.content, 'lxml') # Get all id's for page 1 tumb_id = re.findall(r"id=(.*)';", str(soup), re.MULTILINE) # First one params = (('id', tumb_id[0]),) # Download response = requests.get('http://g2w.ubi.com/farcry2/thumb.php', params=params) with open('tumb.png', 'wb') as f: f.write(response.content)