You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
2.0 KiB

# coding:utf-8
import requests
import time
from lxml import etree
import csv
# import requests
import sys
import io
sys.stdout = io.TextIOWrapper(sys.stdout.buffer,encoding='utf-8')
url="https://www.maoyan.com/films/1334237?requestCode=ab89e2c80d235bfd33c7d2fe39bc9b2amfbdg"
header2 = {
"Cookie": "H_WISE_SIDS_BFESS=40210_40320_40079_40364_40351_40366_40376_40398_40445_40466_40472_40317_40513; BDUSS_BFESS=pvcXVPZFpNMGlnLVRqMGdMRXJ4UGxKU2ZDRjZvWEJtM2RSYUhYd3cwczJiMEJtSVFBQUFBJCQAAAAAAAAAAAEAAABAYT~0tMCz5rPmbG92ZQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADbiGGY24hhmMV; BDSFRCVID_BFESS=UJ4OJeC624xDmubtX6v5rpzIEm47KB5TH6f3ojSHmBX7Qt33nYFJEG0Psx8g0Kub-FLJogKKLmOTHpuF_2uxOjjg8UtVJeC6EG0Ptf8g0f5; H_BDCLCKID_SF_BFESS=JnCH_DDhJKt3fP36q4ofK4_WKUnh-I62aJ0f3qbvWJ5TMCoL04jO-4D30fR3-MQ7bN5y2tta5hOKShPCb6-M3qFq-UriJ-LfLaQLhUby3l02VhQIe-t2yU_IXJJXQ4RMW23rWl7mWPJKfJbND55KLntYhpJBKpIf2J6KaJoCbnLWeIJIjjCMD5v-jaLeq6naaK6H0n6VMTrjDCvvW5Ocy4LdjG5QLMPe0anJXCJD3qvVh-K4ylQpMRIg3-Aq54RkJjQjLMcgWxj8SRcaLJjqQfbQ0-5hqP-jW2cua-KXHR7JOpvshfnxyb80QRPH-Rv92DQMVU52QqcqEIQHQT3m5-5bbN3ht6IJfRKf_K-MtKvbfP0k2KcfbJttbUIX5-RLf5QkVp7F5l8-hl8x3qQWKR0RjxRJbJOEWmTfWM7DtDQxOKQphpQaypjbbqj7-ljRt6baKInN3KJmHpC9bT3vLfuwDJ0L2-biW2JL2Mbd-P5P_IoG2Mn8M4bb3qOpBtQmJeTxoUJ25DnJh-PGe6KWj65LDaLOqbO0K5v0QbP8Kbu38fnDXU6qLT5XeH7wbPnNbN-qBhQ--PczsJCmjU4Kjl0njxQybt6KWD6NXfnhLf5FelQH0MonDh8-3H7MJUntKHTuaMoO5hvv8b6O3M725fKmDloOW-TB5bbPLUQF5l8-sq0x0bOte-bQbG_EJjLjfRkf_KtQ-n8_fbTph4OhhR08-UAX5-RLfaTZ_p7F5l8-hCb9Q-ch-R0RjlDtbJOEWmTL_I3c0D5xOKQIDPn80UkDLRAfQR0etKokKqcN3KJmqPP9bT3v5tjDQ4vZ2-biW2JL2Mbd-P5P_IoG2Mn8M4bb3qOpBtQmJeTxoUJ25DnJhbLGe4bK-TryjNADtUK; ZFY=b:BflOtj91mDiN9pZVZa5s8mhkTL0e:BAjKS5DO:A2Hl18:C; BAIDUID_BFESS=6DE054C0AAD46F264BDDF0A3F9303A0D:FG=1",
"User-Agent": "Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Mobile Safari/537.36"
}
html = requests.get(url, headers=header2).content.decode()
h = etree.HTML(html)
print(html)
title= h.xpath("//div[@class='movie-cn-name']/h1//text()")
print(title)