fateme_abdi
پنج شنبه 29 مهر 1395, 20:55 عصر
سلام من دارم یه فیلم آموزشی می بینم که برای نوشتن خزنده ی وب هستش برنامه نویسی ک آموزش میده با لینوکس کار میکنه ولی من تو ویندوز کار می کنم:
from _symtable import DEF_IMPORT
from setuptools.command.develop import develop
from email.header import UTF8
from lxml import html
import requests
import time
class AppCrawler:
def __init__(self, starting_url, depth):
self.starting_url = starting_url
self.depth = depth
self.apps = []
def crawl(self):
self.get_app_from_link(self.starting_url)
return
def get_app_from_link(self, link):
start_page = requests.get(link)
print start_page
return
class App:
def __init__(self, name, developer, price, links):
self.name = name
self.developer = developer
self.price = price
self.links = links
def __str__(self):
return ("Name: " + self.name.encode('UTF-8') +
"\r\nDeveloper: " + self.developer.encode('UTF-8') +
"\r\nPrice: " + self.price.encode('UTF-8') + "\r\n")
crawler = AppCrawler('https://itunes.apple.com/us/app/candy-crush-saga/id553834731', 0)
crawler.crawl()
for app in crawler.apps:
print app
حالا برای اون برنامه نویس درست اجرا میشه برای من این ارورها میاد:
n27\lib\requests\packages\urllib3\util\ssl_.py:318 : SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#snimissingwarning.
SNIMissingWarning
C:\Python27\lib\requests\packages\urllib3\util\ssl _.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning
from _symtable import DEF_IMPORT
from setuptools.command.develop import develop
from email.header import UTF8
from lxml import html
import requests
import time
class AppCrawler:
def __init__(self, starting_url, depth):
self.starting_url = starting_url
self.depth = depth
self.apps = []
def crawl(self):
self.get_app_from_link(self.starting_url)
return
def get_app_from_link(self, link):
start_page = requests.get(link)
print start_page
return
class App:
def __init__(self, name, developer, price, links):
self.name = name
self.developer = developer
self.price = price
self.links = links
def __str__(self):
return ("Name: " + self.name.encode('UTF-8') +
"\r\nDeveloper: " + self.developer.encode('UTF-8') +
"\r\nPrice: " + self.price.encode('UTF-8') + "\r\n")
crawler = AppCrawler('https://itunes.apple.com/us/app/candy-crush-saga/id553834731', 0)
crawler.crawl()
for app in crawler.apps:
print app
حالا برای اون برنامه نویس درست اجرا میشه برای من این ارورها میاد:
n27\lib\requests\packages\urllib3\util\ssl_.py:318 : SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#snimissingwarning.
SNIMissingWarning
C:\Python27\lib\requests\packages\urllib3\util\ssl _.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning