Gilles Quenot

3

votes
1

answer
7.6k

views

lxml error “IOError: Error reading file” when parsing facebook mobile in a python scraper script

I use a modified script from Logging into facebook with python post : #!/usr/bin/python2 -u # -*- coding: utf8 -*- facebook_email = "[email protected]" facebook_passwd = "YOUR_PASSWORD" import cookielib, urllib2, urllib, time, sys from lxml import etree jar = cookielib.CookieJar() cookie = urllib...
Gilles Quenot
7

votes
1

answer
5.6k

views

How to add a key/value to a dict in an ansible playbook, conditional

Let's say I want to add InterestingVar dict key and the associated value when the variable test_var exists (passed with -e in command line), how can I do that ? # ansible-playbook ./add_to_dict_on_condition.yml -i 127.0.0.1, -e env=test -e test_var=123 - hosts: localhost gather_facts: no vars: - tag...
Gilles Quenot
2

votes
1

answer
5.2k

views

reverse engineer eclipse-PDT-php->UML [duplicate]

Possible Duplicate: PHP UML Generator Hi, I wonder if it's even possible to reverse engineering some PHP (PDT) code back to an UML class diagram ?
Gilles Quenot
6

votes
1

answer
3.8k

views

How to run a POST request programmatically in python with a GUI ? (spynner, webkit…)

I have a web site with flash forms that I need to scrape. Instead of filling the flash forms, I would like to POST some keys/values to the URL that doesn't support GET requests. I use spynner to interact with the site, and spynner can have a GUI, but my search on google, stackoverflow, spynner githu...
Gilles Quenot
2

votes
2

answer
2.1k

views

How to pass argument to a script in vim system() call?

I would like to pass current filename % as argument of the shell script in system() call : let rev=system("~/script %") How can I do that for real ?
Gilles Quenot
3

votes
1

answer
1.2k

views

How to run PyQt4 with flash web page?

I use this very simple python script Problem loading a specific website through Qt Webkit to display a web page. It works well, but it doesn't detect my installed libflashplayer.so on linux x86_64 (that displays http://www.adobe.com/go/getflash/ URL) . What can I do to be able to run flash web pages...
Gilles Quenot
1

votes
1

answer
1.1k

views

How to safely store passwords with greasemonkey?

I wrote a Greasemonkey script, it prompts users to store login and password to avoid the need of re-enter it again and again. I know localStorage.setItem(); to store a key and a value, but the password will be stored as clear text. So, what is the best practice to store a password? Is there any API...
Gilles Quenot
2

votes
1

answer
852

views

Dancer : how to share data and waiting response between 2 POST without blocking

I have a rest server written in perl dancer on a VM, this is the workflow : customers POST some json stuff in /post_wait route : the POST should waiting the business processing to return the result the request is processed by another VMs (communication is processed by POE + IKC) the report should be...
Gilles Quenot
1

votes
2

answer
785

views

How to parse HTML using XPath with Saxon-HE in command line?

I use saxon HE 9.6, and it's great for playing with XPath 3 while you are parsing well formed XML files. But I would like to know how to combine expath-http-client (or any other working solution) with Saxon to have the power to parse realLife©®™ (possibly broken) HTML. (Java is not my better ski...
Gilles Quenot
1

votes
1

answer
736

views

Is it possible to simulate pressing 'Down' arrow?

I try to figure out how to send Down in puppeteer, I tried with the int code 40 or Down string, but none works. Is there a proper way ? Can't figure it out after reading ~/node_modules/puppeteer/lib/Input.js const elementHandle = await page.$('selector'); await elementHandle.type('something'); await...
Gilles Quenot
3

votes
3

answer
427

views

Newline delimited output for Saxon-HE 9.6 from command line

Is there any way to get newline delimited output on multiple matching nodes for Saxon-HE 9.6 ? I use this wrapper named saxon-lint : #!/bin/bash java -cp /path/to/saxon9he.jar net.sf.saxon.Query -s:"$2" -qs:"$1" !method=text Example : file.xml hairballs Dilly Nameless Katie COMMAND LINE : $ saxon-li...
Gilles Quenot
2

votes
1

answer
353

views

Colorize git branch name depending of the state using 'vcs_info'

I'm new to zsh (I'm a long time bash user) I have a custom prompt (made with different sources mixed) with a specific part for git.: I would like to have: - (master) in green if git status says 'clean' - (master) in red if git status says 'not clean' I don't know how can I do it, I'll very appreciat...
Gilles Quenot
2

votes
1

answer
110

views

How to debug an Opsworks/Chef 11.10.4 cookbook locally on Linux (Debian9) using Centos Vagrant guest (Amazon Linux like)

I searched for this for 3 weeks but didn't find any real answer. The main goal is to save time to test dev Chef cookbooks locally before deploying on production on AWS. All I found is some hints using Ubuntu with Vagrant : Chef - How to run a cookbook locally http://pixelcog.com/blog/2015/simplify-o...
Gilles Quenot
1

votes
1

answer
74

views

xpath conditional select, 'tr' having numbers of 'td' > 2

While this seems correct xpath (?), it doesn't match in firefox49/firebug nor chrome dev tools 53.0.2785.116 //table[@id="foobar"]/tbody/tr[count("td") > 2] I try to select all tr having a count() of td > 2
Gilles Quenot