2014-04-19, 16:35
Awesome! which way have you used to save the images ?
with my advert script i used :
To get everything from the website, but then to change the directory i had to include the chdir module and use :
To set the working directory. This way you can have separate folders for different adverts.
And as for taking pictures i already have this integrated in to my skin.
I have created a program that detects your resolution and screenshots the right size for the snap tile. Also the charms bar will detect what window you are on and set the correct label.
I can send you the program and how to use it if you like ? as it works perfectly.
Best Regards.
with my advert script i used :
PHP Code:
import urllib2
import re
import os
from os.path import basename
from urlparse import urlsplit
url = "http://www.xbox.com/en-GB/#fbid=lqvFb1IO9j9"
urlContent = urllib2.urlopen(url).read()
# HTML image tag: <img src="url" alt="some_text"/>
imgUrls = re.findall('img .*?src="(.*?)"', urlContent)
# download all images
for imgUrl in imgUrls:
try:
imgData = urllib2.urlopen(imgUrl).read()
fileName = basename(urlsplit(imgUrl)[2])
output = open(fileName,'wb')
output.write(imgData)
output.close()
except:
pass
To get everything from the website, but then to change the directory i had to include the chdir module and use :
PHP Code:
os.chdir(path)
To set the working directory. This way you can have separate folders for different adverts.
And as for taking pictures i already have this integrated in to my skin.
I have created a program that detects your resolution and screenshots the right size for the snap tile. Also the charms bar will detect what window you are on and set the correct label.
I can send you the program and how to use it if you like ? as it works perfectly.
Best Regards.