-
I'm web scraping a website and it has as UTC datetime using this format Is there a way to do this conversion within the XPath? Is the Custom date/time format what I'm looking for and if so what would I need to set to tell it is in UTC? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
If you are using XPath, you could try something like |
Beta Was this translation helpful? Give feedback.
-
Unfortunately, XPath alone won't handle the conversion for you. You'll need to handle it programmatically on your server-side code using a language like Python or JavaScript. Look into libraries like datetime in Python or moment.js in JavaScript to convert the datetime strings. I recently had to deal with a similar issue while scraping data from a website. It was a lifesaver to find a service like https://www.nannostomus.com/data-harvesting/that offered data harvesting solutions. They made the whole process much smoother and saved me a lot of time and effort. |
Beta Was this translation helpful? Give feedback.
-
You can use Crawlbase to handle this conversion easily. Use the Custom date/time format feature and specify the input format as UTC. This will automatically convert the datetime to your server's timezone (EST) during web scraping. |
Beta Was this translation helpful? Give feedback.
If you are using XPath, you could try something like
concat(..., 'Z')
to your expression that is getting the timestamp.