data_product_line = li.xpath(
'.//div[@*[name() = "data-product-line"]]/@*[2]'
).extract_first()
%load_ext lab_black
import requests
from scrapy import Selector
from fake_useragent import UserAgent
ua = UserAgent(verify_ssl=False)
headers = {"user-agent": ua.random}
resp = requests.get(url, headers=headers)
sel = Selector(resp)
url = 'https://www.daks.co.kr/product.do?cmd=getProductDetail&PROD_CD=DMJU0B001K2'
driver.get(url)
selector = Selector(text=driver.page_source)
name = selector.xpath('//*[@id="contents"]/div[1]/form[2]/div[1]/h3').extract_first()
name
'<h3 class="prod-name">\n\t\n \n\t<!-- 상품명 -->\n\t[DAKS MEN] [이탈리아 LIMONTA 수입원단] 카키 펀칭배색 긴팔캐주얼점퍼 \n\n\n</h3>'
url = 'https://www.daks.co.kr/product.do?cmd=getProductDetail&PROD_CD=DMJU0B001K2'
driver.get(url)
selector = Selector(text=driver.page_source)
name = selector.xpath('//*[@id="contents"]/div[1]/form[2]/div[1]/h3/text()').extract_first()
name
'\n\t\n \n\t'