I inspected code of http://timetomeet.info/new/. I would like to make the same time selector as is here at http://timetomeet.info/new/
Is there any step by step instruction how to do it? I need output for php to process it (so it should be array with times or something like that).
many thanks in advance
I found solution. Just try to extract all js a yahoo scripts and it works.
Related
I'm brand new to programming in general, but specifically Processing, and I need some help on a final project for my digital media class! Using a QR Code Reader library, I've made a sketch in Processing that successfully reads any QR code I throw at it. For the next step, I wanted to find a way to turn the url my sketch displays into a working hyperlink. I want to be able to scan the code, display the url, and click on the url and have it open in my browser. I have steps one and two, but if anyone knows how to write step 3, I'm in desperate need of some advice!
This is the first time in my life I've ever had to code (I'm studying creative writing), and I have yet to get a response on any other forums, so I'd really appreciate the help! Thank you!
I don't know about clicking on text, but there is a way to open a URL in a browser!
You use the link() command. I can't actually find it on the reference page, but it takes a single argument, the URL you want to open.
Here is the example from Processing.org.
I'm trying to extract some data from an amazon product page.
What I'm looking for is getting the images from the products. For example:
https://www.amazon.com/gp/product/B072L7PVNQ?pf_rd_p=1581d9f4-062f-453c-b69e-0f3e00ba2652&pf_rd_r=48QP07X56PTH002QVCPM&th=1&psc=1
By using the XPath
//script[contains(., "ImageBlockATF")]/text()
I get the part of the source code that contains the urls, but 2 options pop up in the chrome XPath helper.
By trying things out with XPaths I ended up using this:
//*[contains(#type, "text/javascript") and contains(.,"ImageBlockATF") and not(contains(.,"jQuery"))]
Which gives me exclusively the data I need.
The problem that I'm having is that, for certain products ( it can happen within 2 pairs of different shoes) sometimes I can extract the data and other times nothing comes out. I extract by doing:
imagenesString = response.xpath('//*[contains(#type, "text/javascript") and contains(.,"ImageBlockATF") and not(contains(.,"jQuery"))]').extract()
If I use the chrome xpath helper, the data always appears with the xpath above but in the program itself sometimes it appears, sometimes not. I know sometimes the script that the console reads is different than the one that appears on the site but I'm struggling with this one, because sometimes it works, sometimes it does not. Any ideas on what could be going on?
I think I found your problem: Its a captcha.
Follow these steps to reproduce:
1. run scrapy shell
scrapy shell https://www.amazon.com/gp/product/B072L7PVNQ?pf_rd_p=1581d9f4-062f-453c-b69e-0f3e00ba2652&pf_rd_r=48QP07X56PTH002QVCPM&th=1&psc=1
2. view response like scrapy
view(respone)
When executing this I sometimes got a captcha.
Hope this points you in the right direction.
Cheers
I'm recently trying to use selenium(Chrome driver one) to get some data in a web. Normally the table shows up to 30 with multiple page, but I changed an argument of it, so It can show me up to 30,000 now.
The problem is, when I use my code to fetch data, it took too long time for it.
I divided it with multiple pages with 2000 data per page, but still it took too long.
This is the code I used to get data
It took about 3? 5? minute when I tried to get 1000 data.
texts = [t.text for t in driver.find_elements_by_xpath("//div[#class='datagrid_class']/div/table[#class='table1']/tbody/tr/td")]
I just want to check if anyone has better idea for this.
Thank you for your kind advice in advance!
Thank you!
You can use JavaScript to get data much faster, try code below:
texts = driver.execute_script('return [...document.querySelectorAll("div.datagrid_class table.table1 tbody tr td")].map(e=>e.textContent)')
Also you can find some more examples here and here
I am a student and in the school website, what I want to do is that I want to busy wait on the certain URL and check if the class i want to register for is open or not. I was wondering if there was a way to constantly check on the website(busy waiting or otherwise) to see if the class is open or not. There is a table Rem where it shows the number of places remaining in the User Interface.
Also what language would you use to solve this problem?
Yes you can. but for that you will probably need to create a script that fetches the value of data from that table.
So something like web scraping should work.
I would definately use php for this stuff.
Google web scraping and you can code the script.
I am not sure if this is the exact thing that will help you, but what you need to do is something similar - See Here
I am new to WayFinder but I have been working with it a bit and it has worked great for me, However I need something a little more dynamic that I'm not sure how to do.
I have a set of 5 pages in my website and each page has another side menu, but each menu for all five resources will be slightly different
I need wayfinder to detect what the current ID is and then display the appropriate menu
I've tried a couple things but nothign i can get to work:
[[!If? &subject=[[*28]] &then=[[Wayfinder? &startId=27&excludeDocs=28,29,30,31,32,33,89]]]]
So I need to say if the ID is = to 28 display this menu if the ID is = to 29 display this one and so on.
I've also tried &idIs=28 and a couple other variations but couldn't really find anything to help me out on this Does anyone else have any ideas how to make this work? Thank you.
With the solution typeset suggest, wayfinder will be called each time thereby causing uneeded loading time to your site. This will be faster because wayfinder only will be called when id = 28.
[[[[*id:is=`28`:then=`Wayfinder? &startId=27 &excludeDocs=28,29,30,31,32,33,89`:else=``]]]]
Read more on it here: http://modx.com/blog/2012/09/14/tags-as-the-result-or-how-conditionals-are-like-mosquitoes/
You can use output filters for conditional calls. Documentation for them is here
You code would looks something like this:
[[*id:is=`28`:then=`[[Wayfinder? &startId=27&excludeDocs=28,29,30,31,32,33,89]]`:else=``]]
If the menu needs to start from the current ID then you'd use
&startId=`[[*id]]`
If you want it to show all the resources in the current folder, you can use UltimateParent, so
&startId=`[[UltimateParent]]`
Hope this helps!
This should work. The subject is just the parameter you are comparing it against so it shouldn't contain the value.
[[!If?
&subject=`[[*id]]`
&operator=`EQ`
&operand=`28`
&then=`[[Wayfinder? &startId=`27` &excludeDocs=`28,29,30,31,32,33,89`]]`
]]