Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

scrapy get inside attribute value

#Given 
<time datetime="2020-09-01T11:48:24-03:00" itemprop="datePublished">a given text</time>

# to get the attribute value datetime:
getData = response.css('time::attr(datetime)').get()

# output
'2020-09-01T11:48:24-03:00'
Comment

PREVIOUS NEXT
Code Example
Python :: concatenate list of strings python 
Python :: how to check any script is running in background linux using python 
Python :: python open google 
Python :: python openpyxl csv to excel 
Python :: pytest teardown method 
Python :: modify a list with for loop and range function in python 
Python :: django oauth toolkit permanent access token 
Python :: python extract substring 
Python :: sklearn ridge regression 
Python :: python turtle fill 
Python :: copy a dictionary python 
Python :: remove part of string python 
Python :: numpy create array with values in range 
Python :: install python3.6 in linux 
Python :: how to convert pandas series to 2d numpy array 
Python :: find element in list that matches a condition 
Python :: edit error page flask 
Python :: how to show mean values on histogram in seaborn 
Python :: accessing items of tuple in python 
Python :: python binary search 
Python :: gdscript tween 
Python :: iterate through directories in python 
Python :: pathlib path forward or back slahses 
Python :: parallel loops in python 
Python :: flask vs django 
Python :: User serializer in django rest framework 
Python :: how to get the last value in a list python 
Python :: access myultiple dict values with list pythojn 
Python :: creating an apis with python and flask 
Python :: from one hot encoding to integer python 
ADD CONTENT
Topic
Content
Source link
Name
6+5 =